Author Topic: Star Trek reloaded (bad pun on the 'ld' command)  (Read 12792 times)

0 Members and 1 Guest are viewing this topic.

Offline ACagliano

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 919
  • Rating: +32/-2
    • View Profile
    • ClrHome Productions
Re: Star Trek reloaded; COUNTDOWN TO BETA
« Reply #15 on: May 12, 2011, 12:57:43 pm »
also, I took the liberty of writing a quick EXAMPLE 3 level gray rendering routine in assembly.  I just took a few minutes to basically show how it'll work in theory -- in implementation I have no idea how this would look, it has some mistakes I'm sure and no interrupt triggering.  But here's what it shoudl look generally like:

Code: [Select]
Level3copyInt
LD HL, Buf1 + 767
LD DE, Buf2 + 767
PUSH HL
PUSH DE
LD C, $10
LD A, $04 ;this uses Y auto-decrement mode ;)
OUT (C), A
LD B,64
LD A,12
PUSH AF

@ ;set to last row
.db $ED,$70
JP M,{-1@}
OUT (C), $BF
@ ;set to last column
.db $ED,$70 ;IN F, (C)
JP M,{-1@}
OUT (C), $2E
LD A,12
PUSH AF
@
LD A, (HL)
AND %10101010
DEC HL
PUSH HL
PUSH AF
LD A, (DE)
AND %01010101
DEC DE
POP HL
OR H
POP HL
@
.db $ED,$70 ;IN F, (C)
JP M,{-1@}
OUT ($11),A
POP AF
PUSH AF
EX DE, HL
DEC A
CP $00
JR Z,{-2@}
DJNZ {-3@}
@
RET


My way of doing it was to merely flash two buffers, using 'call FastCopyb'. Not an interrupt. It is only for a splash screen.
« Last Edit: May 16, 2011, 09:17:30 am by ACagliano »

Ashbad

  • Guest
Re: Star Trek reloaded (bad pun on the 'ld' command)
« Reply #16 on: May 12, 2011, 12:59:36 pm »
thing is, when you flash between two buffers mindlessly, you'll get awful seizure-inducing effects ;) you need to do a simple dithering thing like I just did to get it somewhat close -- and with crystal timers and interrupts, you can make it almost-flickerless ;)

Offline ACagliano

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 919
  • Rating: +32/-2
    • View Profile
    • ClrHome Productions
Re: Star Trek reloaded (bad pun on the 'ld' command)
« Reply #17 on: May 12, 2011, 04:08:32 pm »
Ok. Can someone add to that a way to trigger interrupts, then how to disable them. I'd rather not mess with interrupts myself. Once that is done, I'll give the code a whirl and fix it up (if it needs it).

Edit: First successful compile. This seems to freeze:

Code: [Select]
quit:
b_call(_ClrLCDFull)
ld hl,AppVar
b_call(_Mov9toOp1)
b_call(_ChkFindSym)
jr nc,overwrite
createappvar:
ld hl,AppVar
b_call(_Mov9toOp1)
ld hl,14
b_call(_CreateAppVar)
overwrite:
ld a,b
or a
jp nz,unarc2
ld hl,ShieldPoints
ld bc,8
ldir
ld hl,photons
ld bc,6
ldir
ld hl,AppVar
b_call(_Mov9toOp1)
call arcf
ret
« Last Edit: May 12, 2011, 04:18:50 pm by ACagliano »

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Star Trek reloaded (bad pun on the 'ld' command)
« Reply #18 on: May 12, 2011, 04:18:49 pm »
ACag I tried converting the picture, but with no luck O.O. I think the ship is just too dark. Increasing the contrast messes with the background.

EDIT: This is pretty much the best I could get:
« Last Edit: May 12, 2011, 04:24:33 pm by DJ_O »

Offline ACagliano

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 919
  • Rating: +32/-2
    • View Profile
    • ClrHome Productions
Re: Star Trek reloaded (bad pun on the 'ld' command)
« Reply #19 on: May 13, 2011, 06:11:45 pm »
Thanks anyway.

**Bump

Ok. Can someone add to that a way to trigger interrupts, then how to disable them. I'd rather not mess with interrupts myself. Once that is done, I'll give the code a whirl and fix it up (if it needs it).

Edit: First successful compile. This seems to freeze:

Code: [Select]
quit:
b_call(_ClrLCDFull)
ld hl,AppVar
b_call(_Mov9toOp1)
b_call(_ChkFindSym)
jr nc,overwrite
createappvar:
ld hl,AppVar
b_call(_Mov9toOp1)
ld hl,14
b_call(_CreateAppVar)
overwrite:
ld a,b
or a
jp nz,unarc2
ld hl,ShieldPoints
ld bc,8
ldir
ld hl,photons
ld bc,6
ldir
ld hl,AppVar
b_call(_Mov9toOp1)
call arcf
ret

Offline ralphdspam

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 841
  • Rating: +38/-1
  • My name is actually Matt.
    • View Profile
Re: Star Trek reloaded (bad pun on the 'ld' command)
« Reply #20 on: May 13, 2011, 11:46:50 pm »
I'm a big fan of Star Trek, and I am looking forward to your game.  The first person aspect sounds promising.  :)
ld a, 0
ld a, a

Offline ACagliano

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 919
  • Rating: +32/-2
    • View Profile
    • ClrHome Productions
Re: Star Trek reloaded (bad pun on the 'ld' command)
« Reply #21 on: May 14, 2011, 11:25:09 am »
Uploaded screenie: When I run the part that freezes in game alone, it works fine, and creates the appvar....Why is it not working right in game?

See AppVar  STSave.
« Last Edit: May 14, 2011, 11:25:30 am by ACagliano »

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: Star Trek reloaded (bad pun on the 'ld' command)
« Reply #22 on: May 14, 2011, 11:25:57 am »
Maybe it's code at some other section that's freezing up?




Offline ACagliano

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 919
  • Rating: +32/-2
    • View Profile
    • ClrHome Productions
Re: Star Trek reloaded (bad pun on the 'ld' command)
« Reply #23 on: May 14, 2011, 11:34:57 am »
Maybe it's code at some other section that's freezing up?

I'm trying something else. It's an optimization too. Previously, anytime you need to Arc/Unarch a variable, I use b_call(_Arc_Unarc) and a jump loop.  From now on, I will have it as a call, not a jump and it will use either b_call(ArchiveVar) or (UnarchiveVar).

Offline ACagliano

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 919
  • Rating: +32/-2
    • View Profile
    • ClrHome Productions
Re: Star Trek reloaded (bad pun on the 'ld' command)
« Reply #24 on: May 14, 2011, 12:52:44 pm »
Ok, so I now have the code from Axe:

Code: [Select]
ld a,i
push af
di
ld a,$80
out ($10),a
ld (OP2),sp
ld hl,flags+asm_Flag2
rr (hl)
sbc a,a
xor %01010101
ld (hl),a
ld c,a
ld l,appbackupscreen&$ff-1
ld sp,plotSScreen-appbackupscreen
__DispGSNext:
ld a,l ;4
ld b,64 ;7
add a,$21-(appbackupscreen&$ff);7
out ($10),a ;11 Into loop: 59 T-states
inc l ;4
ld h,appbackupscreen>>8 ;7
ld de,appbackupscreen-plotSScreen+12;11
__DispGSLoop:
ld a,(hl) ;7 Loop: 61 T-states
rrc c ;8
and c ;4
add hl,sp ;11
or (hl) ;7
out ($11),a ;11
add hl,de ;11
djnz __DispGSLoop ;13/8 Next Loop: 60 T-states
ld a,l ;4
cp 12+(appbackupscreen&$ff);7
jr nz,__DispGSNext ;12
__DispGSDone:
ld sp,(OP2)
pop af
ret po
ei
ret

Now, how do I pass the location of the buffer data?

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: Star Trek reloaded (bad pun on the 'ld' command)
« Reply #25 on: May 14, 2011, 05:08:38 pm »
Remember not to double-post unless it's been six hours :)

Is that code the three-level grayscale routine? Remember that the buffer is plotSScreen and the back-buffer is appBackUpScreen, so just replace those with whatever you're using.

EDIT: And make sure you know how the code works. It's a bad idea to go about using ASM code without knowing exactly what it does, because it makes messing up that much easier.
« Last Edit: May 14, 2011, 05:09:24 pm by Deep Thought »




Offline ACagliano

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 919
  • Rating: +32/-2
    • View Profile
    • ClrHome Productions
Re: Star Trek reloaded (bad pun on the 'ld' command)
« Reply #26 on: May 14, 2011, 05:12:52 pm »
Remember not to double-post unless it's been six hours :)

Is that code the three-level grayscale routine? Remember that the buffer is plotSScreen and the back-buffer is appBackUpScreen, so just replace those with whatever you're using.

EDIT: And make sure you know how the code works. It's a bad idea to go about using ASM code without knowing exactly what it does, because it makes messing up that much easier.

Thanks Deep. Although, I think I'll use mono for v1.0. Look at what I got to work:

Offline ACagliano

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 919
  • Rating: +32/-2
    • View Profile
    • ClrHome Productions
Re: Star Trek reloaded (bad pun on the 'ld' command)
« Reply #27 on: May 15, 2011, 01:53:37 pm »
A great deal of progress on the data handling. I've decided that instead of trying to create the appvar on first run, the appvar gets tested for upon Quiting. If none is found, it is created before quitting. On startup of the game, the appvar is only handled if it exists, in which case the data is sent to RAM.

As for networking, I know that having attacks, joins, and quits sent alongside position updates can be taxing on CALCnet. Thus, I have decided to have the position update fire every THREE cycles of the main loop, not every ONE cycle. All other transmissions will fire immediately.

Offline ACagliano

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 919
  • Rating: +32/-2
    • View Profile
    • ClrHome Productions
Re: Star Trek reloaded; COUNTDOWN TO BETA
« Reply #28 on: May 16, 2011, 09:19:14 am »
COUNTDOWN TO BETA

I hope to have a beta release out soon. It won't have exceptional graphics, but it will be functional...

Offline Munchor

  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6199
  • Rating: +295/-121
  • Code Recycler
    • View Profile
Re: Star Trek reloaded (bad pun on the 'ld' command)
« Reply #29 on: May 16, 2011, 09:19:50 am »
COUNTDOWN TO BETA

I hope to have a beta release out soon. It won't have exceptional graphics, but it will be functional...

That sounds great, will wait to see it :D