Lesson P33 - Hardware Sprites on the PC Engine (TurboGrafx-16)

PC-Engine AKA TurboGrafx-16 Programming
Post Reply
User avatar
akuyou
Posts: 562
Joined: Mon Apr 22, 2019 3:19 am
Contact:

Lesson P33 - Hardware Sprites on the PC Engine (TurboGrafx-16)

Post by akuyou » Tue Oct 22, 2019 9:11 pm

The PC Engine is capable of 64 hardware sprites, each of which is 16 color, and is 16x16 in size.

This gives the PCE some pretty impressive graphical capablilities - lets learn how to make some sprites!



https://www.chibiakumas.com/6502/platfo ... #LessonP33
Chibi Akuma(s) Comedy-Horror 8-bit Bullet Hell shooter! // 「チビ悪魔」可笑しいゴシックSTG ! // Work in Progress: ChibiAliens

Interested in CPU's :Z80,6502,68000,6809,ARM,8086,RISC-V
Learning: 65816,ARM,8086,6809

PierreGTT
Posts: 6
Joined: Sun Dec 05, 2021 11:14 am

Re: Lesson P33 - Hardware Sprites on the PC Engine (TurboGrafx-16)

Post by PierreGTT » Thu Dec 16, 2021 8:33 pm

Hi,

In my PCE program, some text is displayed as background. There is also a cursor made from hardware sprites. I would like the text to be video inverted when the cursor moves over.

Is there any hardware XOR operation that could be done between background and sprite's pixels or is it to be done through software?

User avatar
akuyou
Posts: 562
Joined: Mon Apr 22, 2019 3:19 am
Contact:

Re: Lesson P33 - Hardware Sprites on the PC Engine (TurboGrafx-16)

Post by akuyou » Sat Dec 18, 2021 9:32 am

I don 't think you have any choice but to do it with software.

I'm not aware that the PC Engine can do any kind of transparency or other 'calculated' effects like Xor
Chibi Akuma(s) Comedy-Horror 8-bit Bullet Hell shooter! // 「チビ悪魔」可笑しいゴシックSTG ! // Work in Progress: ChibiAliens

Interested in CPU's :Z80,6502,68000,6809,ARM,8086,RISC-V
Learning: 65816,ARM,8086,6809

PierreGTT
Posts: 6
Joined: Sun Dec 05, 2021 11:14 am

Re: Lesson P33 - Hardware Sprites on the PC Engine (TurboGrafx-16)

Post by PierreGTT » Sun Jan 16, 2022 10:47 am

OK thanks for your confirm.

PierreGTT
Posts: 6
Joined: Sun Dec 05, 2021 11:14 am

Re: Lesson P33 - Hardware Sprites on the PC Engine (TurboGrafx-16)

Post by PierreGTT » Thu Feb 17, 2022 11:54 am

Other question:

Let's suppose I need 4 sprites, I will set up first 4 SATB entries so that they point the sprites defined in VRAM. Shall I also setup remaining 60 entries so that they point a neutral (invisible) sprite to avoid displaying unexpected patterns?
This question is worth as unless I'm wrong, there isn't any per sprite ON/OFF flag which tells a given sprite is activated or not.

PierreGTT
Posts: 6
Joined: Sun Dec 05, 2021 11:14 am

Re: Lesson P33 - Hardware Sprites on the PC Engine (TurboGrafx-16)

Post by PierreGTT » Fri Feb 18, 2022 11:16 am

Or maybe simply setting sprite's coordinates to 0,0 so that the sprite doesn't display in the visible area of the screen would be enough...

User avatar
akuyou
Posts: 562
Joined: Mon Apr 22, 2019 3:19 am
Contact:

Re: Lesson P33 - Hardware Sprites on the PC Engine (TurboGrafx-16)

Post by akuyou » Sun Feb 20, 2022 3:33 am

Yes, You should do either of those things!
To my knowledge, most systems don't have an 'off function' for hardware sprites.

I think setting the sprite to an offscreen Y position will be best, as most systems have a smallish horizontal sprite limit of 8 or so sprites (even if the hardware is capable of 64+ onscreen sprites), and even if the sprite was 'blank' I guess it will count towards that limit, but putting it on an offscren horizontal line will keep the visible line limits free.
Chibi Akuma(s) Comedy-Horror 8-bit Bullet Hell shooter! // 「チビ悪魔」可笑しいゴシックSTG ! // Work in Progress: ChibiAliens

Interested in CPU's :Z80,6502,68000,6809,ARM,8086,RISC-V
Learning: 65816,ARM,8086,6809

Post Reply

Return to “PC-Engine Assembly Programming”