Next tasks?

Discuss coding questions, pull requests, and implementation details.
AnKor
Posts: 2
Joined: Tue Nov 22, 2016 12:03 pm

Re: Next tasks?

Post by AnKor »

I'm glad I could help :)
Sometimes a fresh look can be very useful.

User avatar
Interkarma
Posts: 7236
Joined: Sun Mar 22, 2015 1:51 am

Re: Next tasks?

Post by Interkarma »

And now DFTFU can read Daggerfall's CFA files, specifically the horse and cart. :)
df-horse.gif
df-horse.gif (15.27 KiB) Viewed 7849 times
df-cart.gif
df-cart.gif (15.85 KiB) Viewed 7849 times
I found Daggerfall is using a cut-down version of Arena's CFA format. It doesn't need the lookup table or muxing, always uses the same palette, and always has an 8-bit wide pixel format. It made for an easy code at my end, but of course means the CFA reader in DFTFU will not support Arena CFA files. That wasn't really a priority anyway.

Thank you again for aiming me in the right direction! The answer was literally looking me in the face, but I had discounted it for whatever reason and remained blind. Your fresh set of eyes was most helpful.

R.D.
Posts: 379
Joined: Fri Oct 07, 2016 10:41 am

Re: Next tasks?

Post by R.D. »

Great! That must feel good to have that mystery solved.

Did you notice there are also two other .CFA files, MOON00I0.CFA and MOON01I0.CFA?

Also I looked at the Dosbox debugger and looks like MRED00I0.CFA and MRED01I0.CFA, along with MOON00I0.CFA and MOON01I0.CFA, are among the files accessed when starting the program.

User avatar
Interkarma
Posts: 7236
Joined: Sun Mar 22, 2015 1:51 am

Re: Next tasks?

Post by Interkarma »

Yep, noticed those two. Here they are exported to gif.
MOON00I0.gif
MOON00I0.gif (13.47 KiB) Viewed 7835 times
MOON01I0.gif
MOON01I0.gif (27.32 KiB) Viewed 7835 times
Assuming these are the moons Masser & Secunda. Fascinating Daggerfall loads them at startup, as I don't believe you ever see them in the night sky. Were these visible in Arena, can anyone remember? The last time I looked at Arena was in the 90s.

User avatar
Arctus
Posts: 60
Joined: Mon Mar 23, 2015 12:28 am

Re: Next tasks?

Post by Arctus »

Seems like they were used in some sort of DF beta images:

Image

Image

User avatar
Interkarma
Posts: 7236
Joined: Sun Mar 22, 2015 1:51 am

Re: Next tasks?

Post by Interkarma »

Woooah. They would have looked great. I wonder why they ended up being cut?

Seriously, any old Daggerfall devs hanging around here? Tell us some war stories, why dontcha? :)

User avatar
Nystul
Posts: 1501
Joined: Mon Mar 23, 2015 8:31 am

Re: Next tasks?

Post by Nystul »

they really look great! would love to see them someday incorporated into the normal sky and the enhanced sky ;)

User avatar
Arl
Posts: 202
Joined: Sun Mar 22, 2015 10:57 am

Re: Next tasks?

Post by Arl »

At last, the mystery got resolved!

The moons are a very interesting curiosity, I guess the oval shape is because of the tall pixel format.
My Deviantart page, I have some Daggerfall stuff in there.

User avatar
Nystul
Posts: 1501
Joined: Mon Mar 23, 2015 8:31 am

Re: Next tasks?

Post by Nystul »

daggerfall used 320x200 pixels which were rectangular on a 4:3 monitor - I think on such a monitor the moons would have had a circular shape

User avatar
InconsolableCellist
Posts: 100
Joined: Mon Mar 23, 2015 6:00 am

Re: Next tasks?

Post by InconsolableCellist »

Wow! Excellent work! And I was about to post about my crazy method I used to pull the sprite out of image memory...!

Image

That's what I get for not checking the forum last night.

I did some crazy shit where I dump the VGA memory from Dosbox (256 KB at A000:0000), and then inject a little assembly program I wrote to pull the palette from the VGA card. I dump these to disk and use the indices in the VGA memory to reconstruct the bitmap. By taking two screenshots I can diff the bytes and extract the actual graphic. Perhaps this'll come in handy in the future.

For references' sake:

Code: Select all

;org 0011:A600

cld ; set stosb to increment di

;load es:di with some target memory location to hold palette
mov eax,0x001C
mov es,ax
mov edi,0x8000

;loop 256 times
mov ecx,0x100

mov ebx,0        ; start at color index 0

pullrgb:

mov ax,0x1015   ; video BIOS func
push ecx
int 0x10
inc bx          ; next color 

; dh = red
; ch = green
; cl = blue
mov al,dh
stosb           ; store al in es:di and increment di
mov al,ch
stosb           
mov al,cl
stosb           

pop ecx
loop pullrgb

; dump 0xFF of bytes 0xFF at the end, as a marker to aid debugging
mov ecx,0xff
mov al,0xff
rep stosb

hlt


; sm CS:EIP FC B8 1C 00 00 00 8E C0 BF 00 80 00 00 B9 00 01 00 00 BB 00 00 00 00 66 B8 15 10 51 CD 10 66 43 88 F0 AA 88 E8 AA 88 C8 AA 59 E2 EB B9 FF 00 00 00 B0 FF F3 AA F4   

; results in palette stored in 001C:8000 - 001C:82FF


The "sm CS:EIP" DosBOX debugger command modifies the memory at the current instruction pointer with the provided sequence of bytes, which is the assembled x86 code that pulls the VGA palette.

Oh well, I'm glad we now have the graphics, AND a new format we can read...along with some juicy hidden images.

Post Reply