Author Topic: Galads Game Dev Thread  (Read 4179 times)

TheOldMan

  • Hero Member
  • *****
  • Posts: 958
Re: Galads Game Dev Thread
« Reply #75 on: February 20, 2018, 08:05:03 AM »
Quote
... I'm going to go for fixed point implementation in asm as that is easier for me

As would I, personally. It's easier to do and will probably end up much faster. :)

The point however, was that a similar thing can be done in C. Not sure why anyone
would want to, but it is possible. :)

[For when you get farther along in this: #asm/#endasm blocks are very useful in HuC. You can
write and debug code in C, and translate it to asm quite easily, and semi-invisibly ]

ParanoiaDragon

  • Hero Member
  • *****
  • Posts: 4619
Re: Galads Game Dev Thread
« Reply #76 on: March 08, 2018, 08:08:07 PM »
Anything new to show, looking forward to your coding progress!

Galad

  • Jr. Member
  • **
  • Posts: 75
Re: Galads Game Dev Thread
« Reply #77 on: March 09, 2018, 01:33:44 PM »
The last part I coded was the sprites"grave stones"that scroll,Ive been busy with porting the balloon game code to z80 assembly"master system" and writing the floor effect in Space Harrier.I know that's disappointing for others that are/did follow the progress,when I'm done I'll come back to these.


Code: [Select]
  call Do_HandleColorRotation
  ld hl,ColorPaletteArray
  ld de, $C000                ;Color Ram Address
  rst DEToVDPControl
  ld c, Port_VDPData
  call Do_UpdatePaletteColors
  jp Label24
;-------------------------------------------------------------
Do_HandleColorRotation:
  ld hl,ColorRotationDelay
  dec (hl)                            ;Decrement ColorRotationDelay
  ret p
  ld a, (ColorRotationDelayC)
  ld (hl), a                          ;ReInit ColorRotationDelay
  inc hl
  ld a, (hl)
  dec (hl)                            ;Decrement ColorRotationIndex
  jp p, +
  ld (hl),$07                         ;ReInit ColorRotationIndex
+:
  and %00000111
  ld bc, (ColorsToRotate)
  ld l, a
  ld h, $00
  add hl, hl
  ld de,ColorRotationFunctionTable
  add hl, de
  ld a, (hl)
  inc hl
  ld h, (hl)
  ld l, a
  jp (hl)
;-------------------------------------------------------------
ColorRotationFunctionTable:
.dw ColorRotationFunction1
.dw ColorRotationFunction2
.dw ColorRotationFunction3
.dw ColorRotationFunction4
.dw ColorRotationFunction5
.dw ColorRotationFunction6
.dw ColorRotationFunction7
.dw ColorRotationFunction8
;-------------------------------------------------------------
ColorRotationFunction1:
  ld hl,ColorRotationArray
  ld (hl), b         ;DarkGreen
  inc hl
  ld (hl), b         ;DarkGreen
  inc hl
  ld (hl), b         ;DarkGreen
  inc hl
  ld (hl), b         ;DarkGreen
  inc hl
  ld (hl), c         ;Light Green
  inc hl
  ld (hl), c         ;Light Green
  inc hl
  ld (hl), c         ;Light Green
  inc hl
  ld (hl), c         ;Light Green
  ret
;-------------------------------------------------------------
ColorRotationFunction2:
  ld hl,ColorRotationArray
  ld (hl), b         ;DarkGreen
  inc hl
  ld (hl), b         ;DarkGreen
  inc hl
  ld (hl), b         ;DarkGreen
  inc hl
  ld (hl), c         ;Light Green
  inc hl
  ld (hl), c         ;Light Green
  inc hl
  ld (hl), c         ;Light Green
  inc hl
  ld (hl), c         ;Light Green
  inc hl
  ld (hl), b         ;DarkGreen
  ret
;-------------------------------------------------------------
ColorRotationFunction3:
  ld hl,ColorRotationArray
  ld (hl), b         ;DarkGreen
  inc hl
  ld (hl), b         ;DarkGreen
  inc hl
  ld (hl), c         ;Light Green
  inc hl
  ld (hl), c         ;Light Green
  inc hl
  ld (hl), c         ;Light Green
  inc hl
  ld (hl), c         ;Light Green
  inc hl
  ld (hl), b         ;DarkGreen
  inc hl
  ld (hl), b         ;DarkGreen
  ret
;-------------------------------------------------------------
ColorRotationFunction4:
  ld hl,ColorRotationArray
  ld (hl), b         ;DarkGreen
  inc hl
  ld (hl), c         ;Light Green
  inc hl
  ld (hl), c         ;Light Green
  inc hl
  ld (hl), c         ;Light Green
  inc hl
  ld (hl), c         ;Light Green
  inc hl
  ld (hl), b         ;DarkGreen
  inc hl
  ld (hl), b         ;DarkGreen
  inc hl
  ld (hl), b         ;DarkGreen
  ret
;-------------------------------------------------------------
ColorRotationFunction5:
  ld hl,ColorRotationArray
  ld (hl), c         ;Light Green
  inc hl
  ld (hl), c         ;Light Green
  inc hl
  ld (hl), c         ;Light Green
  inc hl
  ld (hl), c         ;Light Green
  inc hl
  ld (hl), b         ;DarkGreen
  inc hl
  ld (hl), b         ;DarkGreen
  inc hl
  ld (hl), b         ;DarkGreen
  inc hl
  ld (hl), b         ;DarkGreen
  ret
;-------------------------------------------------------------
ColorRotationFunction6:
  ld hl,ColorRotationArray
  ld (hl), c         ;Light Green
  inc hl
  ld (hl), c         ;Light Green
  inc hl
  ld (hl), c         ;Light Green
  inc hl
  ld (hl), b         ;DarkGreen
  inc hl
  ld (hl), b         ;DarkGreen
  inc hl
  ld (hl), b         ;DarkGreen
  inc hl
  ld (hl), b         ;DarkGreen
  inc hl
  ld (hl), c         ;Light Green
  ret
;-------------------------------------------------------------
ColorRotationFunction7:
  ld hl,ColorRotationArray
  ld (hl), c         ;Light Green
  inc hl
  ld (hl), c         ;Light Green
  inc hl
  ld (hl), b         ;DarkGreen
  inc hl
  ld (hl), b         ;DarkGreen
  inc hl
  ld (hl), b         ;DarkGreen
  inc hl
  ld (hl), b         ;DarkGreen
  inc hl
  ld (hl), c         ;Light Green
  inc hl
  ld (hl), c         ;Light Green
  ret
;-------------------------------------------------------------
ColorRotationFunction8:
  ld hl,ColorRotationArray
  ld (hl), c         ;Light Green
  inc hl
  ld (hl), b         ;DarkGreen
  inc hl
  ld (hl), b         ;DarkGreen
  inc hl
  ld (hl), b         ;DarkGreen
  inc hl
  ld (hl), b         ;DarkGreen
  inc hl
  ld (hl), c         ;Light Green
  inc hl
  ld (hl), c         ;Light Green
  inc hl
  ld (hl), c         ;Light Green
  ret
;-------------------------------------------------------------
.


« Last Edit: March 09, 2018, 01:35:24 PM by Galad »

ParanoiaDragon

  • Hero Member
  • *****
  • Posts: 4619
Re: Galads Game Dev Thread
« Reply #78 on: March 09, 2018, 05:23:01 PM »
Well, either way, I look forward to more PCE progress when you get around to it!