CPCteleraNext framework

Here a post to introduce CPCteleraNext, a fork of cpctelera with new features.

What’s new from original CPCtelera ?

  • Full support of SDCC 4.6.0 with all functions migrated to new call convention _sdcccall(1)
  • ArkosTracker3 integrated (AKG and AKM players) (Arkos Tracker – The best 8-bit Tracker for AY/YM!)
  • ZX0/ZX0B and ZX1/ZX1B compressors integrated (Néstor Gracia)
  • New functions and examples :
    • CPC+ (Asic) functions
    • EasyOverscan functions
    • Sprite clipping / zoom functions
    • Collision functions
    • SpriteBuffer new functions
    • Disc file loader (FDC Tools | Arkos)
    • Disc sector read and write and automatic file data import at specific location.
    • Geometric functions (in progress mode 1 only)
10 Likes

What new since CPCWiki crash (sic) :

  • Updated to SDCC 4.6.0. Fix a lot of bugs of SDCC 4.5.0, code is really more stable, update your version only for this reason !
  • Add disc sector read and write functions and automatic file data import.
  • A lot of reviews on existing code and fix namely on assembly compatibility with old projects and linux compatibility (Thanks Néstor Gracia for all great reviews)

In progress :

2 Likes

Oh now we’re counting versions with BCC and ACC? (Before/after CPCwiki crash) :grin:

1 Like
That could be the reference time for the forum : June 29, day 0 :joy:
1 Like

@Arnaud6128

Thanks for the mention :slight_smile:

I have been enjoying cpcteleraNext a lot, and the improved code generation from sdcc 4.6.0 is excellent.

Regarding the line drawing code, last year I worked on much improved line routines, which are a lot faster, but I’ve only created a mode 0 version. The intention is to one day maybe write a driving game using vector graphics. I need to figure out how to do efficient line clipping though!

1 Like

You can start Mode 0 Line, there is only Mode 1 at the moment :slight_smile:

1 Like

Hi,
i worked this week-end to add to img2cpc utility, the sprite-hardware generation and i updated cpctelera macros to use it.
The example AsteroidPlus was also updated to use it.

If someone need it, it’s pushed on repo cpctelera_next.

4 Likes

Can cpctelera be run under Windows Subsystem for Linux?

From memory cpctelera was OK with WSL, no reasons it doesn’t work with cpcteleraNext.
I use it under Linux and Cygwin64.

I should really get around to trying this out.

How hard is it to migrate from cpctelera and arkos2 to cpctelera next?

By and large it’s just a recompile!

AT3 music is generated automatically now, the only difficulty is, if you have written assembly code, you have to modify the c binding because calling convention is optimized by using register and not stack for parameter.

1 Like

I have stuck to the code that you wrote for AT2.

Automation does sound like a significant improvement, I probably need to try it out and see.

CPCteleraNext v1.04

Here is a new version of CPCteleraNext, at a time when AI is programming very well on our beloved old machines.

Thank you to everyone who contributed to this version and to all CPCteleraNext users, nothing makes me happier than seeing games that use this framework.

What’s new :

  • Geometric functions (for mode 0 and 1) :

    • cpct_drawPlot, cpct_drawCircle and cpct_drawLine(_f) and cpct_clipLine (thanks @ervin for his existing code it help me a lot)
    • cpct_getColorAt and cpct_scanFill by @SagaDS
  • RLE WB (Wonder Boy) compression format (https://www.smspower.org/Development/Compression#WonderBoyInMonsterWorldRLE) :

    • RLE decrunch, RLE z80 compressor
    • DrawSpriteRLE function.
  • Asic :

    • cpct_asicSwapSprite to swap low and high 4-bits (two hardware sprites can share same memory space)
  • Tools :

    • img2cpc : add sprite hardware generation
  • Installation :

    • “setup.sh --slim” to automaticaly remove obj from tools build
  • Docs :

    • Update to NaturalDocs 2.x (Thanks @MoteroV4 for making migration)
  • And various script fix, better linux compatibility and code reviews / fix.

Thanks for @nestornillo, @SagaDS, @MoteroV4 for helping me on this version.

7 Likes

I don’t know on what working next

  • XOR plots / Mask plot on all geometry function. Like cpct_setDrawMode (SOLID/XOR), cpct_setDrawMask (0..16 draw, 0..16 holes) before calling cpct_drawLine / dawCircle
  • Specific Triangle draw (using clipping) for 3D projects
  • Filled geometry (circles / triangles) with dithering effect between 2 colors based on a 0..255 gradient and 2 pen colors. Also for 3D projects.
  • Speeding a bit more the scanFill and/or decreasing memory need for the stack used.

So fill free to ask if you have a specific need…

2 Likes

I’d love horizontal and vertical scrolling examples, both for the Plus, and a vertical scrolling one for not-Plus. Also an example of Plus-sprite Multiplexing, which I cannot get to work for the life of me, but I know is somewhat possible

1 Like

Yes providing good examples of hardware tricks, working with cpcteleraNext API is a good idea.

1 Like

What i have in mind now, is making game for cartdridge, RASM have already all tookit included.

I have to modify disk_sector_manager.mk to make a cartridge_manager.mk and read carefully how roms works Le Gate Array [Quasar Net]

3 Likes

“cpct_asicSwapSprite to swap low and high 4-bits (two hardware sprites can share same memory space)”

Does that mean what I think it does mean? with proper design, you can have effectively 32 hardware sprites instead of 16? what limitations are there on usage? (on scanline etc)

Looking at the code to cpct_asicSwapSprite, it will not work on real hardware. The sprite registers inside the ASIC are NOT 8-bit, anything written to the upper 4-bits is lost and you cannot read the value back.

1 Like