Report article RSS Feed December 30, 2013 - The Story Continues

I have resumed work on the DaggerXL Beta after taking a break for Christmas. I don’t have much new to show yet but I will talk about a few topics.

Posted by Freak2121 on Dec 30th, 2013

I have resumed work on the DaggerXL Beta after taking a break for Christmas. I don’t have much new to show yet but I will talk about a few topics.

WebUI

On the XL Engine forums there has been mod work towards using the WebUI system that will be present in the Beta release. I talked about this system before in a previous blog post but now Lazaroth has been busy working on a UI mod, using existing web technologies to prototype. I dropped the files into the WebUI folder under the XL Engine and modified a bit of code (that will be externalized for the release) and was able to view the new UI in the current version of the XL Engine. There are a few issues to work out but its a great start and will allow me to work out kinks in the WebUI system. It also shows that using HTML5/CSS/Javascript and a browser is a great way of prototyping new UI ideas and the results can be nearly “drop-in” for use in the XL Engine.

LazarothUI_XLEngine

If you want more information on the mod or to help out, check out Lazaroth’s thread on the forums.

Anatomy of a For-Loop in Daggerfall

So what does a for-loop look like in Daggerfall? It turns out that recognizing for-loops generated by the compiler is rather simple as you’ll see shortly. I have copied some of the actual assembly code with comments.

code:
z80 code:
mov dword [ebp-0018],00000000

[19A283]        ;for (int i=0; i<27; i++) {

cmp dword [ebp-0018],001B               ;//comparison block

jl 0019A293

jmp 0019A2D1

[19A28B]              ;//for-loop counter block

mov eax,[ebp-0018]

inc dword [ebp-0018]

jmp 0019A283

[19A293]              ;//code block

...

jmp 0019A28B

[19A2D1]        ;} //for (int i=0; i<27; i++)

 


The actual assembly code is on the left, with code addresses shown in brackets [ ]. As you can see the local variable, ‘i’ as I named it, is at ebp-0×18. So the first thing that happens is to fill the value with 0, basically the i=0; part of the for-loop. Next it enters the comparison block where the local variable is compared to a value – in this case 0x1B = 27, and if the comparison is successful the execution jumps to the code block, otherwise it jumps to the end of the loop (the last line shown above).

When you see the C/C++ code

code:
cpp code:
for (int i=0; i<27; i++)

{

 

Post comment Comments
xivel
xivel Dec 31 2013, 11:36am says:

Very nice!

+2 votes     reply to comment
Guest
Guest Jan 6 2014, 11:19pm says:

This comment is currently awaiting admin approval, join now to view.

Guest
Guest Jan 27 2014, 12:01pm says:

This comment is currently awaiting admin approval, join now to view.

Post a Comment
click to sign in

You are not logged in, your comment will be anonymous unless you join the community today (totally free - or sign in with your social account on the right) which we encourage all contributors to do.

2000 characters limit; HTML formatting and smileys are not supported - text only

News
Browse
News
Report Abuse
Report article
Related Mods
DaggerXL (Daggerfall)
DaggerXL Daggerfall - Single Player Role Playing
Related Games
Daggerfall
Daggerfall Single Player Role Playing
Related Groups
XL Engine Dev
XL Engine Dev Developer