- Top Stats

Top Posters Top Topic Starters Top Topics
Gryzor 2526
TFM 1672
MacDeath 1273
Puresox 1054
arnoldemu 1030
Gryzor 100
Puresox 65
ComSoft612... 63
cpc4eva 55
Xyphoe 53
Converted GX40... - 258923 Views remax 00:14, 05 May 15
R-Type - 95175 Views Keith A Go... 05:08, 25 February 10
Converting a g... - 75935 Views FRAGKI-201... 01:30, 28 March 13
Quick question... - 69257 Views sigh 18:17, 07 December 10
Bubble Bobble ... - 65751 Views Xyphoe 07:54, 05 January 11


Author Topic: Scramble - New game for Amstrad CPC  (Read 4515 times)

0 Members and 1 Guest are viewing this topic.

Offline PuzCPC

  • CPC464
  • **
  • Posts: 44
  • Country: si
  • Liked: 135
Re: Scramble - New game for Amstrad CPC
« Reply #50 on: 15:48, 10 March 19 »
Very interesting!

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

Code: [Select]
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. :)
« Last Edit: 16:03, 10 March 19 by PuzCPC »

Offline Arnaud

  • Supporter
  • 464 Plus
  • *
  • Posts: 474
  • Country: fr
  • Liked: 372
Re: Scramble - New game for Amstrad CPC
« Reply #51 on: 16: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

Offline Targhan

  • Supporter
  • 6128 Plus
  • *
  • Posts: 844
  • Country: fr
  • Liked: 761
Re: Scramble - New game for Amstrad CPC
« Reply #52 on: 16:05, 10 March 19 »
Hey, why don't you use the stack instead of a loop?

RET instead of decreasing and looping.

Offline PuzCPC

  • CPC464
  • **
  • Posts: 44
  • Country: si
  • Liked: 135
Re: Scramble - New game for Amstrad CPC
« Reply #53 on: 16:14, 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

Offline PuzCPC

  • CPC464
  • **
  • Posts: 44
  • Country: si
  • Liked: 135
Re: Scramble - New game for Amstrad CPC
« Reply #54 on: 16:21, 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

Offline Targhan

  • Supporter
  • 6128 Plus
  • *
  • Posts: 844
  • Country: fr
  • Liked: 761
Re: Scramble - New game for Amstrad CPC
« Reply #55 on: 18:27, 10 March 19 »
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.

« Last Edit: 18:28, 10 March 19 by Targhan »

Offline PuzCPC

  • CPC464
  • **
  • Posts: 44
  • Country: si
  • Liked: 135
Re: Scramble - New game for Amstrad CPC
« Reply #56 on: 19:31, 10 March 19 »

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

Offline AxelStone

  • CPC664
  • ***
  • Posts: 92
  • Country: es
  • CPC 464+
  • Liked: 42
Re: Scramble - New game for Amstrad CPC
« Reply #57 on: 21:27, 10 March 19 »
The feeling is totally arcade, really a great job!!  ;) ;)

Offline jomicamp

  • CPC464
  • **
  • Posts: 26
  • Liked: 9
Re: Scramble - New game for Amstrad CPC
« Reply #58 on: 02:53, 11 March 19 »
Fantastic job!
What a great conversion! Congratulations and, by the way,...
What about converting Galaga??!!  ;D


Best regards

Offline ervin

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.254
  • Country: au
    • index.php?action=treasury
  • Liked: 927
Re: Scramble - New game for Amstrad CPC
« Reply #59 on: 08:36, 11 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
My (cancelled) entry for the CPCRetroDev 2017 Competition http://www.cpcwiki.eu/forum/programming/my-cpcretrodev-2017-entry/
FAST line drawing in CPCtelera http://www.cpcwiki.eu/forum/programming/drawing-lines-with-cpctelera-sdcc/
RUNCPC My entry for the CPCRetroDev 2015 Competition http://www.cpc-power.com/index.php?page=detail&num=12494

Offline Golem13

  • CPC464
  • **
  • Posts: 26
  • Country: fr
  • Liked: 67
Re: Scramble - New game for Amstrad CPC
« Reply #60 on: 15:20, 11 March 19 »
Excellent conversion.
Really very good work, with a sensations and result very faithful to the arcade.
Congratulations, I just love it!

Offline dakidski

  • Speccy
  • *
  • Posts: 2
  • Country: dk
  • Liked: 1
Re: Scramble - New game for Amstrad CPC
« Reply #61 on: 21:25, 11 March 19 »
Simply amazing. Thanks!

Offline Arnaud

  • Supporter
  • 464 Plus
  • *
  • Posts: 474
  • Country: fr
  • Liked: 372
Re: Scramble - New game for Amstrad CPC
« Reply #62 on: 21:34, 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.

Offline Xyphoe

  • 6128 Plus
  • ******
  • Posts: 885
  • Country: gb
    • GX4000.CO.UK
  • Liked: 308
Re: Scramble - New game for Amstrad CPC
« Reply #63 on: 22: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 :)


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

Offline alex76gr

  • CPC664
  • ***
  • Posts: 143
  • Country: gr
  • Liked: 91
Re: Scramble - New game for Amstrad CPC
« Reply #64 on: 12:45, 12 March 19 »
Another hi-score after 2 complete loops.
I'll be back.
« Last Edit: 12:48, 12 March 19 by alex76gr »
I still believe that i got my myopia from the green GT-65 monitor, but i can't prove it! :)

Offline VincentGR

  • 6128 Plus
  • ******
  • Posts: 982
  • Country: gr
    • Parts from the past.
  • Liked: 452
Re: Scramble - New game for Amstrad CPC
« Reply #65 on: 13:01, 12 March 19 »
When the highscore race started, I had Alex in mind...
You have no chance.
To blit, or not to blit?
Amiga 1200 Black Project

Offline Hammer

  • Speccy
  • *
  • Posts: 1
  • Country: de
  • Liked: 1
Re: Scramble - New game for Amstrad CPC
« Reply #66 on: 19:18, 12 March 19 »
Will there be a tape version for all the 464 users?

Offline MiGaNuTs

  • CPC464
  • **
  • Posts: 10
  • Country: fr
  • Liked: 11
Re: Scramble - New game for Amstrad CPC
« Reply #67 on: 19:24, 12 March 19 »
omg, it's so fast !
good job.

Offline GUNHED

  • 6128 Plus
  • ******
  • Posts: 1.047
  • Country: de
  • Reincarnation of TFM
  • Liked: 547
Re: Scramble - New game for Amstrad CPC
« Reply #68 on: 00:03, 13 March 19 »
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 (Recent update: 2019.01.14)
http://futureos.cpc-live.com/files/LambdaSpeak_RSX_by_TFM.zip --> Get the RSX-ROM for LambdaSpeak :-) (Ver.: 2018.08.15)

Offline PuzCPC

  • CPC464
  • **
  • Posts: 44
  • Country: si
  • Liked: 135
Re: Scramble - New game for Amstrad CPC
« Reply #69 on: 15:28, 13 March 19 »

Hi,
Tape version is added! 8)


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  :)



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


Offline SpDizzy

  • CPC464
  • **
  • Posts: 19
  • Country: es
  • Liked: 7
Re: Scramble - New game for Amstrad CPC
« Reply #70 on: 12:38, 21 March 19 »
Hi,
Tape version is added! 8)
Thanks so much for that .cdt version, just waiting to enjoy it on my 464!!

Offline zhulien

  • 464 Plus
  • *****
  • Posts: 357
  • Country: au
    • 8bitology
  • Liked: 138
Re: Scramble - New game for Amstrad CPC
« Reply #71 on: 19:27, 30 March 19 »
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


Offline zhulien

  • 464 Plus
  • *****
  • Posts: 357
  • Country: au
    • 8bitology
  • Liked: 138
Re: Scramble - New game for Amstrad CPC
« Reply #72 on: 19:36, 30 March 19 »
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)?
« Last Edit: 20:44, 30 March 19 by zhulien »