News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu
avatar_PuzCPC

Scramble - New game for Amstrad CPC

Started by PuzCPC, 01:37, 06 March 19

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

PuzCPC

#50
Quote from: ervin on 14:27, 10 March 19
Very interesting!

I'm wondering if it can be optimised a little bit.
8)


ADD HL,BC
DEC A
OR A
JR NZ,LOOP
RET


Is the OR A needed?

Actually, I notice that you're using ADD HL,BC.
Is DE free in your sprite loop?
If it is, you can use ADD HL,DE instead.
That will then allow you to replace the looping code I've quoted just above with DJNZ, if you use B as the loop counter instead of A.




Is the OR A needed? You right! No!
This code is for drawing 8x136px  tall sprite. Yes, I need DE for sprite loop.
ADD HL,BC is the same as:
LD A,L
ADD &50
LD L,A
JR NC,SKIP
INC H

SKIP:
No more space for optimizing anything. I think. :)

Arnaud

@PuzCPC and @ervin

Can you explain me a little about compiled sprites ?

All i my understand is the sprite datas are directly included in the code. That right ?

;D

Targhan

Hey, why don't you use the stack instead of a loop?

RET instead of decreasing and looping.
Targhan/Arkos

Arkos Tracker 2.0.1 now released! - Follow the news on Twitter!
Disark - A cross-platform Z80 disassembler/source converter
FDC Tool 1.1 - Read Amsdos files without the system

Imperial Mahjong
Orion Prime

PuzCPC

Quote from: Targhan on 15:05, 10 March 19
Hey, why don't you use the stack instead of a loop?

RET instead of decreasing and looping.

How? Please explain.
You know, I could not even set up a new stack addr. ;D

PuzCPC

PuzCPC

Quote from: Arnaud on 15:02, 10 March 19
@PuzCPC and @ervin

Can you explain me a little about compiled sprites ?

All i my understand is the sprite datas are directly included in the code. That right ?

;D

I'm still a student and not a teacher. ;D ;D

Targhan

#55
It's something called "RET table". It requires you to divert the stack, at least momentarily.

Let's say you want to have a "displayStuff" called 5 times. The normal way, using A:
   ld a,5
displayStuff
   ...
   dec a
   jr nz,displayStuff

With a RET table:
   ld sp,RetTable
DisplayStuff
   ...
   ret
AfterDisplayStuff
   ...
RetTable
   dw DisplayStuff
   dw DisplayStuff
   dw DisplayStuff
   dw DisplayStuff
   dw DisplayStuff
   dw AfterDisplayStuff

This saves one 8 bit register, and is one cycle faster (RET is 3 cycles, djnz is 4/3 if no jump, dec a+jr nz is the same).
This has some constraint of course, but I think it is rather elegant. You can also set SP to RetTable + 2/4/6 etc. if you need to change the loop counter, no need to duplicate the RetTable if you don't need to.

Targhan/Arkos

Arkos Tracker 2.0.1 now released! - Follow the news on Twitter!
Disark - A cross-platform Z80 disassembler/source converter
FDC Tool 1.1 - Read Amsdos files without the system

Imperial Mahjong
Orion Prime

PuzCPC


Hi,
Thank you very much for the explanation!
This will help me at the next project.
PuzCPC

AxelStone

The feeling is totally arcade, really a great job!!  ;) ;)

jomicamp

Fantastic job!
What a great conversion! Congratulations and, by the way,...
What about converting Galaga??!!  ;D


Best regards

ervin

Quote from: Arnaud on 15:02, 10 March 19
@PuzCPC and @ervin

Can you explain me a little about compiled sprites ?

All i my understand is the sprite datas are directly included in the code. That right ?

;D

Hi Arnaud.

A compiled sprite is actually a program/function that draws the sprite.
It's fast because it doesn't have to navigate through a data table of byte values, but it takes up more memory because it contains the instructions *and* the byte values to print the sprite.
It's very helpful for transparency, as there is no need to check for a transparent byte value. That byte can simply be skipped over with INC in the compiled sprite code.

This is a great post to read:
http://www.cpcwiki.eu/forum/programming/compiled-sprites/msg124169/#msg124169

Golem13

Excellent conversion.
Really very good work, with a sensations and result very faithful to the arcade.
Congratulations, I just love it!

dakidski

Simply amazing. Thanks!

Arnaud

Quote from: ervin on 07:36, 11 March 19
Hi Arnaud.

A compiled sprite is actually a program/function that draws the sprite.
It's fast because it doesn't have to navigate through a data table of byte values, but it takes up more memory because it contains the instructions *and* the byte values to print the sprite.
It's very helpful for transparency, as there is no need to check for a transparent byte value. That byte can simply be skipped over with INC in the compiled sprite code.

This is a great post to read:
http://www.cpcwiki.eu/forum/programming/compiled-sprites/msg124169/#msg124169

Thanks @ervin,
i just tried to draw opaque sprite in this way and i have got a moderate speed gain (around %20) but it takes too much memory.

Xyphoe

Amazing work! I think it's arcade perfect!
Here's my little longplay of it (1 loop, no life lost) taken from Friday's Amstream :)


https://www.youtube.com/watch?v=maQN0NZUhfw

alex76gr

#64
Another hi-score after 2 complete loops.
I'll be back.
I still believe that i got my myopia from the green GT-65 monitor, but i can't prove it! :)

VincentGR

When the highscore race started, I had Alex in mind...
You have no chance.

Hammer

Will there be a tape version for all the 464 users?

MiGaNuTs


GUNHED

Decades ago I loved to play Avenger on CBS, I got really good at that, now I suck with entering higher stages here... but hey, I can poke it.  ;D



http://futureos.de --> Get the revolutionary FutureOS (Update: 2023.11.30)
http://futureos.cpc-live.com/files/LambdaSpeak_RSX_by_TFM.zip --> Get the RSX-ROM for LambdaSpeak :-) (Updated: 2021.12.26)

PuzCPC


Hi,
Tape version is added! 8)


Quote from: Xyphoe on 21:46, 11 March 19
Amazing work! I think it's arcade perfect!
Here's my little longplay of it (1 loop, no life lost) taken from Friday's Amstream :)


Thanks for the video! I enjoyed watching! GG  :)



Quote from: alex76gr on 11:45, 12 March 19
Another hi-score after 2 complete loops.
I'll be back.



Omg, you're really good! :o
For me, meteors are usually fatal.
Same as on a Arcade when I was a boy. ;D


SpDizzy

Quote from: PuzCPC on 14:28, 13 March 19
Hi,
Tape version is added! 8)
Thanks so much for that .cdt version, just waiting to enjoy it on my 464!!

zhulien

I just watched the Xyphoe video of Scramble, wow!!!  that's awesome.

It makes my all time best arcade port list to Amstrad CPC for sure, which is now (not in any specific order):


- Scramble- Frogger
- R Type (both versions, but the remake obviously is noteworthy)
- Donkey Kong
- Moon Cresta
- Elevator Action *
- Star Wars *
- Empire Strikes Back *


* only just worthy of best arcade port list, in all cases the audio isn't faithful enough but I love the Elevator Action music though


zhulien

#72
Will we ever see a Super Cobra port?  Perhaps 90% of Scramble source can be re-used for that?  or a physical release (wishful thinking)?

BSC

Hej PuzCPC, your game looks fantastic and was among my favourites back in the olden days. Well done!
** My SID player/tracker AYAY Kaeppttn! on github **  Some CPC music and experiments ** Other music ** More music on scenestream (former nectarine) ** Some shaders ** Some Soundtrakker tunes ** Some tunes in Javascript

My hardware: ** Schneider CPC 464 with colour screen, 64k extension, 3" and 5,25 drives and more ** Amstrad CPC 6128 with M4 board, GreaseWeazle.

XeNoMoRPH

your amstrad news source in spanish language : https://auamstrad.es

Powered by SMFPacks Menu Editor Mod