News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu
avatar_cpcitor

A programming library that displays a CPC screen's content.

Started by cpcitor, 08:10, 20 December 14

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

cpcitor

Hello all, happy Christmas.

I thought there was a library that you can use on a modern OS (typically SDL-based) that could display some memory portion just like the CPC "MODE 0" "MODE 1" and "MODE 2" would.

That's useful when writing software in C for the CPC on a PC and running the code as regular PC code. One benefits from all the modern comfort (C-level debugger etc). This library would allow to see what's on the screen, too. :-)

The library would just need to be informed about memory area, mode and palette and that's it. Just a matter of a few function calls. I'm not talking about cycle-accurate die-hard demo raster etc, that definitely needs a full emulator.


This assumes that enough code is in C so that this becomes interesting. That's how I program anyway. :-)

But I can't find such a library.




Why cross-programming from a more powerful platform ?

Doom was cross-programmed on NeXT workstations, under the NEXTSTEP operating system (ref. Development of Doom).

Why writing portable C code ? Won't it hurt performance ?

Doom was originally written in reasonably portable C, with only about 200 lines of DOS-specific assembly to draw horizontal/vertical lines of pixels.

Running sloccount on ftp://ftp.idsoftware.com/idstuff/source/doomsrc.zip yields:

SLOC   Directory   SLOC-by-Language (Sorted)
36293   doomsrc         ansic=36103,asm=190


You might consider this interesting article about Doom3 source code: The Exceptional Beauty of Doom 3's Source Code. Id practiced some simplifications that are considered evil in a pure general context but are actually good for high-performance and code readability.




I nearly remember seeing some web page a few years ago describing such a CPC screen library.
Does such a cpc screen lib exist or has my memory flipped some bits ?
Had a CPC since 1985, currently software dev professional, including embedded systems.

I made in 2013 the first CPC cross-dev environment that auto-installs C compiler and tools: cpc-dev-tool-chain: a portable toolchain for C/ASM development targetting CPC, later forked into CPCTelera.

cpcitor

Here is what I found closest to what I describe:

* a tool that read a file and displays it using SDL cpcVideo - cpcsdk - CPC file viewer and video effects prototyping engine with . Does a lot of other things and is an executable not a library,
* but it appears to use a library written in C++ /trunk/cpctools/tools/cpcVideo/libVideoCPC/ - cpcsdk - Collection of tools for

If that library is suitable I might write a C wrapper for it suitable to be called from a portable C code when it runs on the PC.

If you have any other idea or suggestion you're welcome to share.  :)
Had a CPC since 1985, currently software dev professional, including embedded systems.

I made in 2013 the first CPC cross-dev environment that auto-installs C compiler and tools: cpc-dev-tool-chain: a portable toolchain for C/ASM development targetting CPC, later forked into CPCTelera.

Powered by SMFPacks Menu Editor Mod