Angband.oook.cz
Angband.oook.cz
AboutVariantsLadderForumCompetitionComicScreenshotsFunniesLinks

Go Back   Angband Forums > Angband > Development

Reply
 
Thread Tools Display Modes
Old January 23, 2016, 00:53   #1
Pete Mack
Prophet
 
Join Date: Apr 2007
Location: Seattle, WA
Posts: 5,420
Donated: $40
Pete Mack is on a distinguished road
Dev tracking for pete

QUICKBAND

TODO:
* Get NPP 0.4.x code
* .h files.
* ui files
* gameplay files.

DONE:
* edit files
* Prepared local "quickband" git branch in NPP 0.5.2
* Fixed horrible tot_dam_aux in NPP/Quick. (Especially Quick.)
* merge edit files.
Pete Mack is offline   Reply With Quote
Old January 23, 2016, 00:57   #2
Pete Mack
Prophet
 
Join Date: Apr 2007
Location: Seattle, WA
Posts: 5,420
Donated: $40
Pete Mack is on a distinguished road
ANGBAND:

TODO:
verify basic functionality.
re-debug bug mentioned in replay thread.

DONE:
* get & compile replay zip files.
Pete Mack is offline   Reply With Quote
Old January 23, 2016, 07:42   #3
Pete Mack
Prophet
 
Join Date: Apr 2007
Location: Seattle, WA
Posts: 5,420
Donated: $40
Pete Mack is on a distinguished road
Mysteries in Vanilla changes

z-bitflag.h

I don't understand what is happening in flag_has. What is all the sizeof stuff? Why is it there? I can think of what might be there. But it's not what I expected.
Pete Mack is offline   Reply With Quote
Old January 27, 2016, 20:45   #4
Pete Mack
Prophet
 
Join Date: Apr 2007
Location: Seattle, WA
Posts: 5,420
Donated: $40
Pete Mack is on a distinguished road
Quick question: is ui_event_type member redundant?

in mouse and keyboard structs, there appears to be an extra event type. Can I just duplicate the one in the containing ui_event struct for logging, or do I need to log it separately?
Pete Mack is offline   Reply With Quote
Old January 27, 2016, 23:20   #5
Pete Mack
Prophet
 
Join Date: Apr 2007
Location: Seattle, WA
Posts: 5,420
Donated: $40
Pete Mack is on a distinguished road
The replay logging update will not be easy. I am finding cases where new characters are pushed all the way to the Term_ in the code. (This is a new change that breaks the API boundary model and thus is a breaking change for logging.) It breaks logging because if the fake keystroke is logged, it will get executed twice during replay: first the newly inserted one, and then one inserted when it was logged. I suppose the way to fix this is to disable the insertion during replay, so the logged version will get played, and the "inserted" one will never happen. This change is turning into a nightmare, because:
1. Headers are much more complex than in 3.1.v2, when I made the change initially. Just figuring out where to put extern function declarations is a chore.
2. Structures have changed.
2a. File names are all different, so just tracking down where the deltas belong is not trivial.
3. Mouse clicks are treated directly at various points in the code, so they no longer can be uniformly converted to "rich keystrokes" in util.c`inkey (or I should say ui-event.c`inkey.)

PLAN: remove all z-term.h references except the one in ui-event.c. This will control access to Term_ to the place where logging is done. (The borg works here too, so I suspect any things that break logging will likely break the borg.)
I am putting this change on hold while I instead make the code more C99 like as a familiarization task. I just discovered that my_strcmp &c are still present, which is crazy.
Pete Mack is offline   Reply With Quote
Old January 28, 2016, 01:48   #6
takkaria
Veteran
 
takkaria's Avatar
 
Join Date: Apr 2007
Posts: 1,936
Donated: $40
takkaria is on a distinguished road
Quote:
Originally Posted by Pete Mack View Post
in mouse and keyboard structs, there appears to be an extra event type. Can I just duplicate the one in the containing ui_event struct for logging, or do I need to log it separately?
You don't have to log it separately. The 'containing' ui_event is a union, not a struct, so ui_event.type and ui_event.mouse.type are the same memory location.
__________________
takkaria whispers something about options. -more-
takkaria is offline   Reply With Quote
Old January 28, 2016, 02:37   #7
Pete Mack
Prophet
 
Join Date: Apr 2007
Location: Seattle, WA
Posts: 5,420
Donated: $40
Pete Mack is on a distinguished road
I get that. But I have to use different logging code for each because I am using network-byte-order rather than native (as the savefile already does.) Although I guess this doesn't matter much anymore since essentially everyone use x86 architecture now, unless you are playing on an ARM or _really_ old OSX.
Anyway, that is the least of the problems. The tricky part is finding out what later changes that use the mouse actually require tweaking so the logger doesn't fail. It is extremely sensitive to things that work like macros--that is, things that inject/delete keystrokes into the terminal or events into the event stream (though latter shouldn't be a problem, since I *think* I made sure that all such code is bypassed by logging.)

Quote:
Originally Posted by takkaria View Post
You don't have to log it separately. The 'containing' ui_event is a union, not a struct, so ui_event.type and ui_event.mouse.type are the same memory location.
Pete Mack is offline   Reply With Quote
Old January 28, 2016, 07:51   #8
Pete Mack
Prophet
 
Join Date: Apr 2007
Location: Seattle, WA
Posts: 5,420
Donated: $40
Pete Mack is on a distinguished road
Ansi C changes so far

Question: What does making angband ANSI compliant mean? I have done some simple cleanup. I'd like to get this over with, and submit it back to github if at all possible.

In a fresh angband master clone I have:
* got rid of my_str* functions and replaced with the standard where possible, or renamed them otherwise.
* Checked that the return codes from the "real" functions are treated properly. (One of the my_str* functions returned int where it should really return character pointer.)
* Removed all the #if standard C code from headers.
* Removed special declarations of MAX_SHORT, MAX_UCHAR.
* Changed BOOL, TRUE, FALSE to bool, true, false
* added <stdbool.h> and <stdint.h> unconditionally.

Other possible steps:
* Use "official" c types, and replace u32b with uint32_t, etc.
* Use htonl <arpa/inet.h> or <ws32.h> type stuff in the save file instead of home grown functions in savefile.c

I used the following script to actually make the changes so far, except the details in .h files and otherwise missing includes:

Code:
# NOTE: You will have to fix z-util.c and z-util.h specially.

CAT > junk.sed << EOF
s/my_stristr/stristr/g
s/my_stricmp/stricmp/g
s/my_strcat/strncat/g
s/my_strcpy/strncpy/g
s/my_strcap/strcap/g
s/my_stricmp/stricmp/g
s/strcat/strncat/g
s/TRUE/true/g
s/FALSE/false/g
s/BOOL/bool/g
s/MAX_SHORT/SHRT_MAX/g
s/MAX_UCHAR/UCHAR_MAX/g
EOF

for i in `egrep -l 'MAX_SHORT|MAX_UCHAR|strcat|my_str|TRUE|FALSE|BOOL' *.h */*.h *.c */*.c ` ;do

echo $i
sed -f junk.sed $i > $i.new 
mv -f  $i.new $i
done

rm junk.sed

Last edited by Pete Mack; January 28, 2016 at 07:58.
Pete Mack is offline   Reply With Quote
Old January 28, 2016, 10:34   #9
Pete Mack
Prophet
 
Join Date: Apr 2007
Location: Seattle, WA
Posts: 5,420
Donated: $40
Pete Mack is on a distinguished road
Is the checked in code in github expected to work currently? I am seeing it spin (infinite loop) immediately on character creation in a build I just downloaded from the Angband/Angband branch. "On accept character? (Y/N/c) it just hangs, with a single core pinned.
Pete Mack is offline   Reply With Quote
Old January 28, 2016, 12:44   #10
Nick
Vanilla maintainer
 
Nick's Avatar
 
Join Date: Apr 2007
Location: Canberra, Australia
Age: 54
Posts: 7,862
Donated: $60
Nick will become famous soon enough
Quote:
Originally Posted by Pete Mack View Post
Is the checked in code in github expected to work currently? I am seeing it spin (infinite loop) immediately on character creation in a build I just downloaded from the Angband/Angband branch. "On accept character? (Y/N/c) it just hangs, with a single core pinned.
Is that the angband branch of angband/angband, or the master branch? because the angband branch is over 3 years old - I'm not even sure what it's doing there.

Edit: And master is working for me, after a make clean and reinstall (but not freshly downloaded).
__________________
One for the Dark Lord on his dark throne
In the Land of Mordor where the Shadows lie.

Last edited by Nick; January 28, 2016 at 13:09.
Nick is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[3.5 dev] Tiny bug in dev 581 (permanent scrolls!) Ingwe Ingweron Vanilla 8 October 15, 2013 06:21
3.5-dev bug eMeM Vanilla 3 May 14, 2013 09:07
First 3.4 dev version Magnate Development 33 August 29, 2011 15:30
Tracking Angband using Mercurial (DVCS) d_m Vanilla 5 June 18, 2009 23:45
[D] Bug tracking help request. APWhite Variants 1 July 24, 2007 11:35


All times are GMT +1. The time now is 23:44.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.