IRC logs for #opendune on OFTC at 2011-07-30
            
00:00:57 <TrueBrain> http://devs.opendune.org/~truebrain/emu_status.txt
00:01:08 <TrueBrain> the emu_'s left :)
00:01:26 <TrueBrain> not that many :D
02:36:40 *** tneo- has joined #openDune
02:36:40 *** Osai^2 has joined #openDune
02:37:04 *** tneo has quit IRC
02:37:04 *** Osai has quit IRC
03:27:05 *** glx has quit IRC
05:44:58 <planetmaker> 07:43 DorpsGek: [01:28:56] SVN: truebrain (r2101) [LibEMU] -Fix: don't think you do a right click on scrollwheel actions etc (silly really) <-- \o/
08:08:03 *** Alberth has joined #openDune
08:08:03 *** ChanServ sets mode: +o Alberth
08:34:21 <Alberth> wow, 40 revisions!
09:24:40 <Alberth> Xaroth|Work: the OpenDUNE News forum has 4 announcements for version 0.1 0.2 0.3 and 0.4. In particular, 0.5 is not an announcement.
09:24:40 <Alberth> Wouldn't it be simpler to just drop those announcements? 'News' are almost by definition already announcements.
09:56:02 <Xaroth|Work> actually I had originally planned to have the latest announcement to be a global announcement
09:56:08 <Xaroth|Work> so it pops up on every subforum
09:56:29 <Xaroth|Work> but yeh, the older don't have to be announcements
10:02:00 <Alberth> good idea
10:27:35 <TrueBrain> so go fix it Xaroth|Work :D
10:30:00 <TrueBrain> Alberth: http://devs.opendune.org/~truebrain/temp.patch
10:30:02 <TrueBrain> would you mind testing that?
10:32:40 <Alberth> how many temp.patch files do you have? :p
10:32:55 <TrueBrain> just 1 :)
10:36:50 <Alberth> did you enable a immediately-win flag?
10:37:20 <TrueBrain> no :P
10:37:48 <Alberth> I just won the first scenario in less than1 second :)
10:38:01 <TrueBrain> hmmmm
10:38:04 <TrueBrain> that is ... wrong :P
10:39:02 <Alberth> level 2 starts normally
10:40:15 <TrueBrain> glx had the issue on windows that when he pressed a key, the game frooze or something
10:40:20 <TrueBrain> and I can't see what that would happen :(
10:40:56 <Alberth> seems to be working
10:41:08 <TrueBrain> haha, L1 indeed immediatly completes
10:41:12 <TrueBrain> is because of the delay :D
10:41:18 <Alberth> I even managed to get a security question correct :p
10:41:29 <TrueBrain> you seen that I made the fadein work correctly?
10:41:41 <Alberth> yeah, nice
10:41:42 <TrueBrain> now it takes just long enough, that the first 'are you done' check comes ...
10:41:45 <TrueBrain> 1000 is the goal
10:41:47 <TrueBrain> you start with 1000 :P
10:41:54 <TrueBrain> just normally 1 goes away relative fast enough
10:42:49 <Alberth> it takes a bit getting used to, it also happens after returning from the factory window, which I find a bit distracting
10:43:18 <TrueBrain> yeah, and it is a bit too slow tbh
10:43:35 <Alberth> on load, that's fine imho
10:43:46 <TrueBrain> yup; I agree
10:43:49 <TrueBrain> we will have to change that
10:44:19 <TrueBrain> but at least you now see it, instead of it seemly hanging for a few :D
10:45:04 <TrueBrain> it is weird, you can't win the game in the first 7200 ticks
10:45:05 <TrueBrain> hmm
10:45:47 <TrueBrain> negative value
10:45:49 <TrueBrain> that is not nice
10:46:26 <Alberth> wouldn't that be a hack for the 1st scenario? :)
10:46:51 <TrueBrain> it is
10:46:52 <Alberth> although setting the initial money to 999 would have been simpler :)
10:47:25 <Alberth> ooh, lots of s_input_local->* variables
10:48:26 <TrueBrain> but any idea why my patch would fail on windows?
10:49:20 <DorpsGek> SVN: truebrain (r2102) -Fix (2086): somehow one timer got replaced by the wrong one
10:49:24 <TrueBrain> there, that solves L1 issues :)
10:49:36 <TrueBrain> and what do you think about the patch itself, the approach for it?
10:50:07 <TrueBrain> I rather have the game in a big loop with this at the end of the loop, but I don't see that happening with all the while (true) loops we have :(
10:55:07 <Xaroth|Work> TrueBrain: it was already fixed.
10:56:28 <Alberth> with 'it' being the windows key freeze issue?
10:57:08 <Alberth> the only thing I can think of is that libemu assumes a keyboard handler, which it does not get now
10:57:37 <Alberth> the patch itself (code wise) looks fine while scanning it.
10:58:34 <Alberth> as for the approach, I have absolutely no idea how the big picture works :(
11:02:48 <Alberth> perhaps call 'this' (whatever it is precisely) as a subroutine from the various while(true) loops?
11:08:57 <TrueBrain> that is also an option
11:09:03 <TrueBrain> I now hooked it in the timer interrupt :P
11:09:20 <TrueBrain> I don't like the while (timer > globalTimer) sleep(0) loops either
11:09:29 <TrueBrain> but I don't see how we can remove them :P
11:09:33 <TrueBrain> something to do over time :)
11:12:44 <Alberth> they are a bit like the if(timer > globalTimer) return; code, but the flow of control is probably wrong to do that in a simple way.
11:12:58 <DorpsGek> SVN: truebrain (r2103) -Fix: MSVC blabla
11:13:09 <TrueBrain> yup
11:13:28 <Alberth> dorpsgek should autofix msvc :)
11:14:20 <TrueBrain> :P
11:14:40 <TrueBrain> I tried to get Rub to add OpenDUNE to the buildbot, but buildbot can't handle 2 projects well :(
11:18:38 <Alberth> I did some hacking for source code in bb too, but that was for distributing copies of the same source from one check-out
11:21:01 <TrueBrain> I wonder where to put SDL stuff for MSVC ..
11:22:35 <Alberth> os/windows/video_sdl.c ?
11:22:47 <TrueBrain> no, I mean libSDL :P
11:22:54 <TrueBrain> I assume the project file assumes it somewhere
11:22:56 <TrueBrain> no clue where :P
11:38:44 <TrueBrain> hmm .. it seems that on Windows, a sleep(0) does not allow time for the timer
11:38:47 <TrueBrain> this can't be good :D
11:39:02 <TrueBrain> how could that ever work, I wonder
11:45:29 <TrueBrain> hmm .. no, it does run the ticker
11:45:30 <TrueBrain> weird
11:48:33 <TrueBrain> owh, yeah, I remember ... SDL has to run in the same thread as you handle events
11:48:36 <TrueBrain> how could I forget
11:56:05 <TrueBrain> SDL 1.3 most likely solves most of those issues
11:56:10 <TrueBrain> but ... not released yet
11:58:27 <Alberth> threads are broken by design imho :)
12:00:00 <TrueBrain> ffs, it keeps crashing under Windows ...
12:00:06 <TrueBrain> what the hell is going on :(
12:13:21 *** glx has joined #openDune
12:13:21 *** ChanServ sets mode: +o glx
12:13:28 <TrueBrain> morning glx :)
12:13:33 <glx> hello
12:13:35 <TrueBrain> found why Windows acted weird with SDL
12:14:16 <glx> ha?
12:14:30 <TrueBrain> libSDL has this annoying restriction that you have to poll events in the same thread as you start the screen on
12:14:36 <TrueBrain> and Windows has 2 threads ... 1 timer, 1 main
12:14:49 <glx> oh yes
12:15:11 <TrueBrain> just ... it doesn't solve the problem completely :(
12:15:16 <glx> I forgot this point
12:15:32 <TrueBrain> mouse causes a random crash (libemu crash report)
12:15:38 <TrueBrain> and keyboard isn't handled (at all)
12:16:15 <glx> a solution would be to skip SDL on windows ;)
12:16:28 <TrueBrain> implement GDI?
12:16:31 <TrueBrain> well, feel free :P :P
12:17:42 <TrueBrain> I guess it shouldn't be too hard with OpenTTD source
12:18:24 <glx> patch is up-to-date ?
12:18:31 <TrueBrain> euh, dunno
12:18:38 <TrueBrain> have been toying with MSVC a lot
12:18:43 <TrueBrain> but that patch is even worse :D
12:19:06 <TrueBrain> k, patch is up-to-date now with the linux version only
12:19:13 <TrueBrain> you want to give the GDI a spin?
12:19:30 <TrueBrain> shall I just commit this and break Windows for the time being, or you want to patch my patch first?
12:19:40 <TrueBrain> well, I do need to work on mouse stuff before this is commitable
12:19:50 <Alberth> CGI sounds like the bad guys in Command & Conquer :p
12:20:03 <glx> I can try to fix SDL first
12:20:12 <Alberth> *GDI
12:20:13 <TrueBrain> I tried that
12:20:16 <TrueBrain> it 'works'
12:20:20 <glx> GDI can be a later improvement (removing a layer)
12:20:21 <TrueBrain> but keyboard is not handled correctly
12:20:31 <TrueBrain> don't know why exactly
12:20:36 <TrueBrain> it registers the key
12:20:43 <TrueBrain> but somehow Dune2 doesn't pick it up
12:20:46 <TrueBrain> owh ... euh ... DUH
12:20:48 * TrueBrain slaps himself
12:20:56 <TrueBrain> I am running it for the first time
12:21:04 <TrueBrain> I will wait 2 minutes :D
12:21:05 <TrueBrain> hahahahahaha
12:21:08 <TrueBrain> *fail*
12:21:09 <glx> and IIRC openttd started with GDI
12:21:17 <glx> then SDL was added
12:21:35 <TrueBrain> I have release libemu and debug opendune
12:21:35 <glx> lol
12:21:37 <TrueBrain> is that a problem?
12:21:44 <TrueBrain> I keep getting these random crashes ...
12:21:50 <glx> better use debug libemu
12:22:03 <glx> even for release opendune
12:22:33 <glx> optimisations somehow break libemu
12:22:56 <TrueBrain> okay, watching the intro now ...
12:22:59 <TrueBrain> how could I forget :p
12:23:02 <TrueBrain> it is so annoying :D
12:23:17 <TrueBrain> nope, random crashes
12:23:21 <TrueBrain> F046:0000
12:23:25 <TrueBrain> shit like that
12:23:28 <TrueBrain> no clue who the caller is
12:23:29 <Alberth> make some coffee in the mean time :)
12:25:51 <TrueBrain> clean trunk even crashes
12:26:38 <glx> with debug libemu ?
12:26:41 <TrueBrain> yes
12:26:53 <TrueBrain> and debug opendune
12:27:02 <glx> you copied .lib and .pdb after updating libemu ?
12:27:21 <TrueBrain> yes
12:27:23 <TrueBrain> just double checked
12:27:29 <TrueBrain> I also started off with the debug version
12:27:36 <TrueBrain> well, not the pdb, just the lib
12:29:44 <TrueBrain> k, uploaded a new patch
12:29:46 <TrueBrain> can you try thatone glx?
12:29:57 <TrueBrain> I disabled mouse, as I thought it was an issue
12:30:02 <TrueBrain> but seemly my version just keeps crashing :P
12:31:57 <glx> keyboard works
12:32:09 <TrueBrain> can you remove the #if 0 around mouse handling?
12:32:28 <glx> I'm playing the intro first
12:33:31 <TrueBrain> I made a new patch, which has slightly less 'win32' special code
12:33:34 <TrueBrain> it should also still work
12:33:43 <TrueBrain> if you can confirm that, that would be awesome ;)
12:35:25 <glx> we need to do something for the while (true) :)
12:35:44 <TrueBrain> yeah, already said to Alberth
12:35:53 <TrueBrain> personally I rather have 1 big while loop, where events are polled at the end
12:35:57 <TrueBrain> but ... atm that is impossible
12:36:05 <TrueBrain> maybe in time ...
12:36:14 <glx> I know
12:38:34 <glx> it works
12:38:42 <glx> mouse too
12:38:43 <TrueBrain> great :)
12:38:51 <TrueBrain> now let me patch the mouse correctly, to avoid libemu ...
12:39:07 <Alberth> great progress :)
12:39:23 <glx> even if it's a little hacky ;)
13:00:52 <TrueBrain> hmm
13:00:54 <TrueBrain> mouse acts weird
13:01:00 <TrueBrain> the x is off
13:01:46 <TrueBrain> ugh
13:01:48 <TrueBrain> uint8
13:01:49 <TrueBrain> haha
13:02:12 <Alberth> don't bother about the right part of the screen :p
13:02:57 <TrueBrain> new temp.patch uploaded
13:03:00 <TrueBrain> can you please try it glx?
13:03:02 <TrueBrain> and you too Alberth?
13:03:16 <TrueBrain> it really ... modifies stuff :D
13:04:19 <glx> does it remove a fil ?
13:04:22 <glx> *file
13:04:25 <TrueBrain> yes
13:04:27 <TrueBrain> decompiled file
13:04:40 <glx> that explain why patch whine
13:05:21 <TrueBrain> bah, seems you can't change the mouse position in a windowed screen :P
13:05:28 <TrueBrain> at least ... it kinda fails :P
13:05:59 <TrueBrain> hmm ... it seems I missed something with the mouse
13:06:04 <TrueBrain> I thought I remembered there were region limits
13:06:09 <TrueBrain> but I couldn't find the normal interrupt
13:06:13 <TrueBrain> but these are syscalls
13:06:14 <TrueBrain> bah :P
13:06:23 <TrueBrain> I wonder, do we care ...
13:06:31 <Alberth> [Compiling] src/video/sdl.c
13:06:31 <Alberth> src/video/sdl.c:275:21: error: redefinition of ‘s_gfx_surface’
13:06:31 <Alberth> src/video/sdl.c:18:21: note: previous definition of ‘s_gfx_surface’ was here
13:06:39 <Alberth> and a lot more of such errors
13:06:39 <TrueBrain> remove new files before applying :)
13:06:49 <TrueBrain> blame subversion for his retardedness
13:08:27 * Alberth also blames patch
13:08:29 <TrueBrain> hmm ... restricted mouse movement doesn't really work with windowed, becuase you want to be able to move your mouse out
13:08:36 <TrueBrain> owh, fuck it, I am not going to implement it
13:08:44 <TrueBrain> or am I .. ugh
13:08:46 <TrueBrain> hard hard hard ...
13:08:48 <TrueBrain> choicesssssss
13:10:31 <glx> patch and added/removed file always fails :)
13:11:10 <glx> Erreur 2 fatal error C1083: Impossible d'ouvrir le fichier source : '..\decompiled\cs__29A3.c' : No such file or directory c1
13:11:19 <glx> :)
13:12:13 * Alberth has problems with the video/video.h file
13:12:31 <TrueBrain> there also, remove it before applying :)
13:12:44 <TrueBrain> basically: svn status src, check for ? or A, remove them :p
13:13:19 <glx> works for me
13:13:38 <glx> or patch -R the previous version
13:15:06 <TrueBrain> both mingw and MSVC glx?
13:15:46 <TrueBrain> mouse movement feels less smooth
13:15:48 <TrueBrain> meh
13:16:57 <glx> yes both work
13:17:15 <TrueBrain> doubleWidth shit is ANNOYING :P
13:18:04 <glx> there's a bug in animations :)
13:18:11 <TrueBrain> more detail?
13:18:15 <glx> text goes away too fast
13:18:24 <glx> (not related to the patch I think)
13:18:35 <glx> I noticed it in intro too
13:19:12 <glx> oh in outro it's always the same image
13:19:20 <glx> that's also a bug
13:20:15 <Alberth> I just noticed that when a soldier fires at a trike, the fire 'hits' at the wrong position (at the rear of the vehicle). Not sure whether that also happens in original Dune2 though
13:20:55 <TrueBrain> glx: everything goes too fast, it seems?
13:21:04 <glx> only texts
13:21:41 <TrueBrain> Alberth: launch DOSBox and check? :D
13:22:32 <TrueBrain> glx: also ingame text you see, yeah
13:22:47 <TrueBrain> maybe timerGUI goes too fast? Which would be odd ...
13:23:06 <glx> I can try to find when that started
13:23:16 <TrueBrain> would be nice
13:23:23 <TrueBrain> but my patch seems to work good, so that is awesome :D:D
13:23:34 <TrueBrain> moved around some things, removed g_doubleWidth, ...
13:24:04 <Alberth> patch seems to work
13:24:14 <TrueBrain> awesome :D
13:24:59 <DorpsGek> SVN: truebrain (r2104) -Add: moved the whole SDL layer into OpenDUNE out of LibEMU. This cleans up many interrupt calls back and forth
13:25:03 <TrueBrain> there we go :D
13:25:15 <TrueBrain> now .... I guess I have to move the pic into OpenDUNE, so we can remove the timer stuff
13:25:26 <TrueBrain> http://devs.opendune.org/~truebrain/emu_status.txt
13:25:30 <glx> maybe we could use SDL timers
13:25:34 <TrueBrain> nice list with stuff we need to take care of :D
13:26:14 <Alberth> you seem to like lists :p
13:26:32 <TrueBrain> gives overview :)
13:26:57 <glx> Avertissement 1 warning C4018: '<' : incompatibilité signed/unsigned d:\developpement\opendune\trunk\src\map.c 1252
13:27:09 <glx> not related to latest commit ;)
13:27:17 <TrueBrain> no, I noticed it too
13:27:23 <TrueBrain> I couldn't see why it was blabbing about that
13:27:25 <TrueBrain> all are unsigned
13:27:32 <TrueBrain> guess unsigned + 75 is signed or what-ever
13:27:54 <glx> g_wallSpriteID + 75 is signed yes
13:28:01 <TrueBrain> silly
13:28:29 <Alberth> we should use C++ :p
13:29:37 <TrueBrain> I was wondering how long it would take you to suggest that :D :P
13:30:03 <TrueBrain> glx: didn't we try SDL timers? I remember something odd was going on there
13:30:57 <glx> dunno
13:31:24 <glx> sdl doc says 1.2.13 is required for them
13:32:05 <TrueBrain> ah, yes, Windows problems
13:32:09 <TrueBrain> AddTimer makes a thread on windows to run in
13:32:12 <TrueBrain> much like we do
13:32:16 <TrueBrain> but .. then you can't poll events
13:32:23 <TrueBrain> so you get a chicken-egg problem I guess :D
13:32:31 <TrueBrain> although in the current way it should be possible
13:32:37 <TrueBrain> but then what if you want to use GDI for windows ..
13:32:39 <TrueBrain> hmm
13:33:27 <glx> Note that it is possible to avoid the multithreading problems with SDL timers by giving to userevent.data1 the address of a function you want to be executed and to userevent.data2 its params, and then deal with it in the event loop.
13:33:50 <TrueBrain> but eventloop has to be in the same thread as the setresolution
13:33:54 <TrueBrain> which is the chicken-egg issue :D
13:35:12 <glx> http://www.libsdl.org/cgi/docwiki.cgi/SDL_AddTimer
13:35:23 <glx> The timer callback function may run in a different thread than your main program, and so shouldn't call any functions from within itself. However, you may always call SDL_PushEvent.
13:35:35 <TrueBrain> yup
13:35:40 <TrueBrain> which is exactly our problem :)
13:42:02 <DorpsGek> SVN: truebrain (r2105) -Codechange: removed some unused interrupt handlers
13:44:28 <TrueBrain> glx: any luck finding when the text went quicker?
13:44:50 <glx> 1900 is ok, still bisecting :)
13:46:05 <DorpsGek> SVN: truebrain (r2106) -Fix: a double while loop looks silly
13:46:39 <glx> between 1950 and 1994 ;)
13:47:43 <glx> hmm in 1950 images are wrong in credits
13:51:29 <DorpsGek> SVN: truebrain (r2107) -Add: remove some dead-end code that we don't use/need
13:52:55 <TrueBrain> okay ... now I need to remove stuff from the driver .. as it just does stuff we already do :P
13:53:10 <TrueBrain> but the code is hard to read ... :(
14:00:02 <glx> ok it's 1993
14:01:08 <glx> hehe duplicate was not a duplicate
14:02:43 <TrueBrain> frequency of the normal timer is 60, but our PIC runs at 50 :P Hihi :D
14:03:13 <glx> hmm that may explain the desync for voices in intro ?
14:03:27 <TrueBrain> it should correct for it
14:03:33 <TrueBrain> I build my timer at least that it does, dunno about the driver one
14:03:37 <TrueBrain> going to replace it now :D
14:03:49 <glx> though video is slower than sound in intro
14:14:19 <TrueBrain> usec ... what is usec again? I always forget ...
14:14:26 <TrueBrain> 1000 usec is 1 sec? or 1000,000 usec is 1 sec?
14:15:03 <Alberth> http://en.wikipedia.org/wiki/Microsecond
14:15:09 <DorpsGek> SVN: glx (r2108) -Revert (r1993): duplicate was not duplicate
14:15:45 <glx> ar805A->variable_0008 is not ar805A->variable_0006 ;)
14:15:45 <Alberth> ie 10**-6 :)
14:16:03 <Alberth> glx: well, almost itis :)
14:17:15 <glx> now the credit images
14:18:21 <TrueBrain> wow, my first attempt immediatly works
14:18:23 <TrueBrain> scary
14:18:41 <Alberth> can't be good, try again, to be sure :)
14:18:47 <TrueBrain> haha, I found the fast forward button :D
14:18:49 <TrueBrain> woei
14:18:55 <Alberth> :D
14:19:28 <TrueBrain> http://devs.opendune.org/~truebrain/temp.patch
14:19:43 <TrueBrain> only voices still work with the old version
14:19:49 <TrueBrain> I need to check out how it is done there exactly :P
14:20:01 <glx> it's done via DMA
14:20:10 <TrueBrain> no, the timer :)
14:20:19 <TrueBrain> it is done via the pic, but the code is a bit hard to read atm :)
14:20:26 <TrueBrain> and as I don't have sound, it is hard to test :P
14:20:35 <glx> PIC handles DMA
14:20:50 <TrueBrain> the PIC is done via outb and CustomerInterrupt
14:21:09 <TrueBrain> no DMA involved
14:21:41 <TrueBrain> reminds me, we removed 1 DMA entry, which is the shaking of the screen
14:21:51 <TrueBrain> only I can't remember where it was ... we should reimplement it :)
14:41:32 <TrueBrain> okay, seemyl I am doing something wrong now :D hihi
14:49:29 <TrueBrain> glx: this is going to be a though question I am afraid, but .. http://devs.opendune.org/~truebrain/temp.patch <- can you see if sound works, and why it asserts?
14:49:35 <TrueBrain> you most likely know better what I am doing wrong ..
14:50:02 <TrueBrain> there are 2 things I am not sure off
14:50:08 <TrueBrain> driver->customerTimer
14:50:11 <TrueBrain> it is only removed, never set
14:50:13 <TrueBrain> which is a bit odd
14:50:29 <TrueBrain> and the timer on slot 16. It is enabled, but it has no reference to what it is calling
14:51:57 <TrueBrain> nevermind slot 16, I found it. It is the old timer, so yeah, that is fine :)
14:52:46 <glx> 2 unused parameters ;)
14:53:45 <TrueBrain> come to think of it, it is odd that this works ... lol .. I should make a thingy to disable timers in libemu :P
14:53:58 <TrueBrain> well, my alarm is installed after, but I am not sure what Windows will do :P
14:54:17 <glx> it closes immediately for me (and nothing in logs)
14:54:40 <TrueBrain> :D
14:55:58 <glx> Program Termination: jumped to 0070:0040, which is not decompiled.
14:55:58 <glx> The jump was triggered at d:\developpement\opendune\libemu\src\call.c:135
14:55:58 <glx> The jump appears to originate from 0000:0000.
14:55:58 <glx> Please send the file 'memory/crash.bin' to upstream developers.
14:55:58 <glx> Creating crash-dump ...
14:55:59 <glx> Crash-dump in 'memory/crash.bin'
14:56:08 <glx> more luck with MSVC :)
14:56:15 <glx> (that's the old timer IIRC)
14:57:04 <DorpsGek> SVN: truebrain (r2109) [LibEMU] -Add: make PIC externally disablable
14:57:21 <TrueBrain> please update; also a new temp.patch uploaded
14:57:39 <TrueBrain> it doesn't really help if 2 timer interrupts are running :D
14:58:32 <TrueBrain> btw, where are the AB00 interrupts linked in? I always keep forgetting ..
14:58:37 <TrueBrain> (the 2 hard_links in main.c)
15:00:19 <glx> via emu_DSP_InstallInterrupt()
15:01:11 <TrueBrain> ah, yes, 56F, not 056F :P
15:01:14 <TrueBrain> I keep forgetting that :D
15:02:51 <glx> memory corruption somewhere
15:03:01 <TrueBrain> but it does start etc?
15:03:05 <TrueBrain> and you do hear sound?
15:03:11 <glx> yes
15:03:21 <TrueBrain> wow ...
15:03:32 <TrueBrain> I expect timing to be off :P
15:04:09 <glx> it asserts in MPU_Interrupt
15:04:13 <glx> data_csip = emu_get_csip32(g_mt32mpu_cs, index, 0x12F2);
15:04:13 <glx> data = (MSData *)emu_get_memorycsip(data_csip);
15:04:20 <TrueBrain> found why it asserts :D
15:04:26 <glx> (well in emu_get_memorycsip)
15:04:32 <TrueBrain> new patch :)
15:04:40 <TrueBrain> I forgot g_mt32mpu_cs has 2 pointers :)
15:04:44 <TrueBrain> it switches between them :)
15:04:47 <TrueBrain> DSP vs MPU I believe
15:05:08 <TrueBrain> and if voices (and its timing) is correct then
15:05:11 <TrueBrain> I am a happy man
15:07:25 <TrueBrain> and when I make it a 100Hz clock, animation is also much more smoother
15:07:27 <TrueBrain> whiieee :D
15:08:11 <TrueBrain> hmm ... I thought OpenDUNE did not run at 100% CPU?
15:08:49 <glx> ok voice timing is off
15:08:59 <TrueBrain> off bad off, or just off?
15:09:10 <glx> missing parts
15:09:51 <glx> "known as dune" "land of sand home of the melange" ...
15:10:18 <TrueBrain> ugh, which I could hear sound :(
15:11:32 <TrueBrain> wish
15:13:31 <TrueBrain> if you look in driver.c, there is a Timer_Add, with 1000000 / locsi
15:13:34 <TrueBrain> but that should be correct
15:13:51 <TrueBrain> it is the only 'time' indication I could find
15:18:24 <TrueBrain> hmm, yeah, his behavoir should be near-identical
15:18:29 <TrueBrain> hmm .. wait ... one odd line ...
15:18:35 <TrueBrain> value = value * 10000 / 8380;
15:18:39 <TrueBrain> @calc 10000 / 8380
15:18:39 <DorpsGek> TrueBrain: 1.19331742243
15:18:46 <TrueBrain> could be it
15:18:57 <TrueBrain> euh, glx, if you change line 86 in driver.c (the Timer_Add) to
15:19:03 <TrueBrain> 1000000 / locsi * 10000 / 8380
15:19:11 <TrueBrain> does that solve the timing issue?
15:19:45 <TrueBrain> @calc 1000000 / 60 * 10000 / 8380
15:19:45 <DorpsGek> TrueBrain: 19888.6237072
15:21:20 <DorpsGek> SVN: glx (r2110) -Fix (r1891): credits loop always used the same image
15:21:44 <TrueBrain> nice :D
15:23:37 <glx> still wrong timing
15:23:44 <TrueBrain> how wrong?
15:24:11 <TrueBrain> I mean, is it better, or worse?
15:24:30 <glx> no real change it seems
15:25:55 <glx> locsi is 120
15:26:16 <TrueBrain> do you know how it knows when it is at the end of the voice?
15:26:21 <TrueBrain> what kind of timing is used for it?
15:26:28 <TrueBrain> owh, another idea
15:26:30 <TrueBrain> src/opendune.org
15:26:32 <TrueBrain> Timer_Add
15:26:36 <TrueBrain> make both of them 20000
15:26:47 <TrueBrain> if it uses the general timer, that might just solve it
15:26:59 <TrueBrain> the Dune rotation animation is perfect with those values :D
15:27:04 <glx> I guess it checks Driver_Voice_IsPlaying()
15:27:12 <TrueBrain> uploaded a new patch if you are lazy enough :D
15:27:47 <TrueBrain> @calc 1000000 / 120 * 10000 / 8380
15:27:47 <DorpsGek> TrueBrain: 9944.31185362
15:28:05 <TrueBrain> 10ms, k
15:31:06 <glx> [EMU] [ INB:00 ] Not Yet Implemented
15:31:06 <glx> Creating crash-dump ...
15:31:06 <glx> Crash-dump in 'memory/crash.bin'
15:31:25 <TrueBrain> wuth? When?
15:31:37 <glx> somewhere during the intro
15:31:44 <TrueBrain> but how is the timing?
15:32:52 <TrueBrain> I btw now also know why the dune animation in the intro was wrong :D They do something weird with timer values :p But found that now, so it should be much better :D
15:33:17 <glx> still wrong, it seems it starts new sound before the previous is done
15:33:33 <TrueBrain> and it was correct before my patch?
15:35:53 <glx> in clean trunk it's ok
15:35:57 <TrueBrain> weird
15:35:59 <TrueBrain> very weird
15:36:35 <glx> (except when the emperor speaks, but that's not new, lips and voice are desynced)
15:37:12 <TrueBrain> how off is it, you think?
15:37:21 <TrueBrain> do we talk about seconds, or is it 'just'?
15:37:51 <glx> sometimes it has time to repeat "and no rules of engagement"
15:38:50 <TrueBrain> its not consistent?
15:39:39 <glx> depends on timing :)
15:39:59 <TrueBrain> timing shouldnt be a factor, that is the odd part :P
15:40:35 <glx> IIRC there is some kind of trigger for when a voice should start
15:42:56 <TrueBrain> new patch
15:43:00 <TrueBrain> but now I am just guessing :P
15:45:17 <TrueBrain> and otherwise, another small update ... just guessing to see if the timing can be fixed ...
15:45:28 <TrueBrain> else, I really wouldn't know. It is almost identical to libemu code, so meh ..
15:46:38 <TrueBrain> @calc 1000 / 1193
15:46:38 <DorpsGek> TrueBrain: 0.838222967309
15:46:46 <TrueBrain> hmm .. that number looks familar ...
15:47:49 <TrueBrain> @calc 1000000 / 120 * 10000 / 8380 * 1000 / 1193
15:47:49 <DorpsGek> TrueBrain: 8335.55058979
15:47:55 <TrueBrain> @calc 1000000 / 120 * 10000 / 8380 * 1193 / 1000
15:47:55 <DorpsGek> TrueBrain: 11863.5640414
15:48:09 <TrueBrain> @calc 1000000 / 60 * 10000 / 8380 * 1193 / 1000
15:48:09 <DorpsGek> TrueBrain: 23727.1280827
15:48:13 <TrueBrain> @calc 1000000 / 60 * 10000 / 8380 * 1000 / 1193
15:48:13 <DorpsGek> TrueBrain: 16671.1011796
15:48:15 <TrueBrain> hmm
15:48:18 <TrueBrain> yeah, the latter :D
15:48:29 <TrueBrain> @calc 1000000 / 120
15:48:29 <DorpsGek> TrueBrain: 8333.33333333
15:48:32 <TrueBrain> yeah
15:49:35 <TrueBrain> so another new patch, but this time I am sure that the delays are correct
15:49:43 <TrueBrain> any problem in timing is somewhere else ..
15:50:12 <glx> other timings are correct
15:50:20 <glx> let's try this latest version
15:50:27 <TrueBrain> 'other' timings?
15:50:54 <glx> intro animations are ok, ...
15:52:56 <glx> but voices are still wrong
15:53:11 <TrueBrain> meh
15:53:13 <TrueBrain> no clue
15:53:14 <glx> (voices code is really hard to follow anyway)
15:53:26 <TrueBrain> I double tripple quadrochecked what happens in the old code
15:53:32 <TrueBrain> I see no difference except for much cleaner code :P
15:54:03 <TrueBrain> how are voices played?
15:54:11 <TrueBrain> I mean: is it put in a buffer and said: play?
15:54:19 <TrueBrain> or does it need to change the pitch etc every ms?
15:55:06 <DorpsGek> SVN: truebrain (r2111) -Fix: CTRL+C detection is no longer needed, nor working
15:55:08 <glx> pitch is change when file starts
15:55:30 <DorpsGek> SVN: truebrain (r2112) -Fix: no need to include all those includes anymore
15:55:42 <glx> the driver reads in a buffer and sends it to sound card via dma
15:56:23 <glx> when dma buffer is empty, irq7 is triggered
15:56:42 <glx> (handled by PIC)
15:57:39 <TrueBrain> guess there a problem might be, as the interrupt part of the PIC is not always reset correctly
15:58:05 <TrueBrain> or in fact, it might not be triggered at all
15:58:21 <TrueBrain> nope; it is not called at all
15:58:30 <TrueBrain> so possible there it goes wrong I guess :P
15:59:00 <TrueBrain> guess you should move that from libemu to opendune :D
15:59:23 <glx> probably only the begining of the sound data is sent yes
15:59:39 <TrueBrain> owh, hmm .. we can temporary solve that I guess .. lets try ..
15:59:58 <TrueBrain> IRQ7, so INT15
16:00:50 <glx> right
16:00:50 <TrueBrain> libemu patch: http://devs.opendune.org/~truebrain/temp2.patch
16:00:53 <TrueBrain> it is very wrong
16:01:00 <TrueBrain> but might work :P
16:02:55 <TrueBrain> its a very illegal preempt, but if it works, it works :P
16:03:04 <glx> Program Termination: jumped to 0080:F246, which is not decompiled.
16:03:04 <glx> The jump was triggered at d:\developpement\opendune\libemu\src\call.c:135
16:03:04 <glx> The jump appears to originate from 0000:0000.
16:03:04 <glx> Please send the file 'memory/crash.bin' to upstream developers.
16:03:04 <glx> Creating crash-dump ...
16:03:05 <glx> Crash-dump in 'memory/crash.bin'
16:03:10 <glx> it doesn't work :)
16:03:26 <TrueBrain> weird pointer
16:04:25 <TrueBrain> too bad we can't trace those ...
16:06:43 <TrueBrain> did you hear any voices? As in, does it fix the problem but does this happen after a while, or?
16:09:09 <glx> it starts at "known as dune" then crash
16:09:22 <TrueBrain> meh
16:09:33 <TrueBrain> and I can't reproduce it here, as I don't have voices
16:09:34 <TrueBrain> GRRRR
16:09:39 <TrueBrain> well, first some dinner
16:09:41 <glx> so it still misses "the planet arrakis"
16:09:43 <TrueBrain> I will fiddle with it more after
16:15:46 <TrueBrain> glx: on a clean OpenDUNE, does this libemu patch work: http://devs.opendune.org/~truebrain/temp2.patch
16:15:49 <TrueBrain> as in, voices still okay etc?
16:16:04 <TrueBrain> while cooking, I had an idea :D
16:42:13 <glx> this patch works
16:42:52 <TrueBrain> and in combination with: http://devs.opendune.org/~truebrain/temp.patch
16:42:54 <TrueBrain> ?
16:45:38 <glx> [EMU] [ INB:00 ] Not Yet Implemented
16:45:38 <glx> Creating crash-dump ...
16:45:38 <glx> Crash-dump in 'memory/crash.bin'
16:45:41 <glx> again
16:45:45 <TrueBrain> weird
16:45:48 <TrueBrain> how did voices do?
16:46:01 <glx> same as with other patches
16:46:05 <TrueBrain> ugh
16:46:13 <TrueBrain> this is getting annoying :D
16:46:34 <glx> I think the only way is to implement voices in opendune directly
16:46:41 <glx> (but this driver is ugly)
16:47:04 <TrueBrain> just weird that the patch doesn't work as it should
16:47:35 <glx> but why voices don't work on your machine ?
16:48:04 <TrueBrain> virtual machine fucks up my alsa driver completely
16:48:13 <TrueBrain> and as we found out, MSVC doesn't work :P
16:51:12 <TrueBrain> and SDL Audio refuses to work at all without a valid audio driver :D
16:55:15 <glx> I guess I can try to extract pcm stuff and insert it in AB00, replacing emu_out and emu_in
16:55:41 <glx> will still be ugly but may work
16:56:14 <TrueBrain> I just don't understand why it doesn't work :p
16:56:21 <TrueBrain> and without some weird testing, it is hard to trace :P
16:58:03 <TrueBrain> I wonder about that crash too ... makes no real sense to me ...
17:01:28 <DorpsGek> SVN: truebrain (r2113) [LibEMU] -Add: run the IRQ handler in his own timer, for flexibility
17:02:54 <TrueBrain> I also wonder why for me MSVC crashes ..
17:02:56 <TrueBrain> also makes little sense :P
17:07:27 <TrueBrain> now I wonder if I should commit this or not ...
17:07:29 <TrueBrain> hmm
17:10:33 <TrueBrain> okay, glx, last attempt: http://devs.opendune.org/~truebrain/temp.patch
17:17:26 <TrueBrain> hmm ... 'attack' seems broken btw ... not sure if it is my patch ..
17:18:16 <TrueBrain> no, it is not
17:18:18 <TrueBrain> pfew :D
17:18:34 <glx> it's a little better
17:18:47 <glx> but still not good
17:19:05 <TrueBrain> does it still crash?
17:19:10 <glx> no crash
17:19:21 <TrueBrain> so that is good :)
17:19:26 <TrueBrain> well, the rest we can solve in time
17:19:31 <glx> true
17:19:31 <TrueBrain> kinda out of ideas :D
17:19:37 <TrueBrain> I think it has to do with interrupt locking
17:20:24 <TrueBrain> ugh, this bug I just noticed, I am at r1700 already ...
17:20:36 <glx> :)
17:21:04 <TrueBrain> this does not look promising, if I need to look back this far :P
17:21:30 <TrueBrain> 1500 even fails
17:21:32 <TrueBrain> lolz
17:23:02 <TrueBrain> and before 1200 I get the setup warning
17:23:28 <TrueBrain> ah, yes
17:23:30 <TrueBrain> no dune.cfg yet
17:27:01 <TrueBrain> okay ... I cannot find a working revision
17:27:07 <TrueBrain> below 1000 it doesn't want to start normally
17:27:13 <TrueBrain> basically, when you attack a tile
17:27:15 <TrueBrain> it doesn't work
17:27:22 <TrueBrain> just doesn't
17:27:31 <TrueBrain> can't believe I didn't notice this earlier .... which feels weird ...
17:28:19 <glx> hmm it worked IIRC
17:28:31 <TrueBrain> I thought I tried it a lot
17:28:33 <TrueBrain> but it keeps failing here
17:29:20 <DorpsGek> SVN: truebrain (r2114) -Add: move the PIC code from libemu to OpenDUNE. Voices are not what it should be, but it mostly works
17:29:31 <glx> attacking sand works for me
17:29:45 <TrueBrain> try attacking to the left of you
17:29:51 <TrueBrain> 1 tile
17:29:53 <TrueBrain> 2 tiles work
17:29:55 <TrueBrain> but just next to you
17:30:09 <glx> ha I did left but more than 1 tile
17:30:10 <TrueBrain> go stand 2 tiles to the right and top of another unit
17:30:14 <TrueBrain> now try to shoot the tile above the unit
17:31:13 <TrueBrain> fails even in dosbox
17:31:15 <TrueBrain> so no worries :D
17:31:37 <TrueBrain> hmm, one odd thing, I no longer see the red text blink when clicking in the menu
17:31:47 <TrueBrain> owh, I do
17:31:49 <TrueBrain> just not always
17:31:51 <TrueBrain> bad timing I guess :D
17:33:50 <DorpsGek> SVN: truebrain (r2115) -Fix: remove dead code we will never uncover
17:34:24 <DorpsGek> SVN: truebrain (r2116) -Fix: more dead code
17:34:59 <TrueBrain> okay .. 95% of the remaining emu_ stuff is in the audio
17:35:36 <glx> src/timer.c: In function 'Timer_InterruptWindows':
17:35:36 <glx> src/timer.c:135:45: warning: unused parameter 'arg'
17:35:36 <glx> src/timer.c:135:58: warning: unused parameter 'TimerOrWaitFired'
17:35:52 <DorpsGek> SVN: truebrain (r2117) -Fix: already resolved function names
17:36:16 <TrueBrain> glx: ugh, windows-specific code :)
17:36:21 <TrueBrain> can you please fix that, it is hard to test for me :)
17:36:26 <glx> ok
17:41:08 <DorpsGek> SVN: glx (r2118) -Fix (r2114): mingw warnings
17:41:24 <TrueBrain> thank you :)
17:41:30 <TrueBrain> and tnx for all the testing today :D
17:44:44 <TrueBrain> GameCredits_Play is weird ... it loads g_palette + 256 * 3 * counter
17:44:50 <TrueBrain> which is way passed his pointer most of the time
17:52:01 <TrueBrain> I can't detect anywhere it would be written out of bounds, but for sure it is reading out of bounds
17:53:35 <glx> the size is 20000
17:54:03 <TrueBrain> no, it is not
17:54:06 <TrueBrain> it starts at +20000
17:54:11 <TrueBrain> size is kinda unspoken
17:54:20 <TrueBrain> but g_palette2 is initialized 256*3 after g_palette1
17:54:22 <TrueBrain> after that, nothing
17:54:30 <TrueBrain> counter can be 10, by the looks
17:54:41 <glx> it can be 20 :)
17:55:07 <TrueBrain> no, counter is 8 and goes down (from stage 2)
17:55:13 <TrueBrain> it goes to starge 4 when it is made 20
17:55:22 <TrueBrain> then stage 5 it goes up to 8 again
17:55:25 <TrueBrain> so always between 0 and 7
17:56:39 <glx> right
17:57:16 <TrueBrain> and traced it back to assembly, it indeed seems to say that
17:57:20 <TrueBrain> I don't understand ...
17:58:21 <TrueBrain> how do you get to that CreditsPlay?
17:58:46 <glx> fade in and fade out of images
17:59:01 <glx> finish the game :)
17:59:19 <TrueBrain> owh, wait
17:59:23 <TrueBrain> I think I understand
17:59:32 <TrueBrain> it makes 10 palettes
17:59:33 <TrueBrain> lolz
17:59:38 <TrueBrain> I had to read it twice, but indeed, it does that :)
17:59:48 <TrueBrain> it reads IBM.PAL
17:59:52 <TrueBrain> then goes over it 10 times
18:00:13 <TrueBrain> finish the game he says
18:00:15 <glx> or add GameLoop_GameCredits(); at line 1912
18:00:16 <TrueBrain> well, that is easy
18:00:26 <glx> and just click on Exit :)
18:00:34 <glx> from the intro menu
18:00:52 <TrueBrain> I am now finishing the game :P
18:01:05 <TrueBrain> (I have savegames for that :P)
18:01:34 <glx> me too, but you have to pass the mentat, the HOF and the movie
18:01:36 <TrueBrain> double free detected
18:01:38 <TrueBrain> fuck :P
18:01:54 <glx> my "hack" is easier
18:03:19 <TrueBrain> hmm
18:03:26 <TrueBrain> first fadein was flawed
18:03:32 <TrueBrain> the rest are perfect
18:04:30 <TrueBrain> not my patch :P
18:05:23 <DorpsGek> SVN: truebrain (r2119) -Add: after finally capturing all cases where g_palette1 was needed in the 16bit world, now finally, finally, g_palette1 and g_palette2 in 32bit/64bit world. for real. I think.
18:08:44 <DorpsGek> SVN: truebrain (r2120) -Add: spriteBuffer can now live in 32bit/64bit world. Good for him.
18:08:54 <TrueBrain> lets try valgrind
18:08:56 <TrueBrain> lol
18:08:58 <TrueBrain> this gotta be good
18:09:17 <TrueBrain> not too bad
18:09:33 <TrueBrain> scripts only use uninitialized data
18:18:08 <DorpsGek> SVN: truebrain (r2121) -Add: remove one more Tools_Malloc
18:19:25 <TrueBrain> readBuffer, drivers.c and the general screen pages are left now
18:19:28 <TrueBrain> almost there :)
18:25:28 <TrueBrain> 45 usages of readBuffer
18:25:39 <TrueBrain> I can either keep it, alloc a big page for it, and leave it like that
18:25:44 <TrueBrain> or try to make it a bit more ... sane
18:33:45 <TrueBrain> owh, bah ... Driver_Voice_Play still needs a csip ...
18:33:47 <TrueBrain> grr
18:45:07 <TrueBrain> + /* XXX - Temporary hack so we can have other pointers outside the 16bit world.
18:45:09 <TrueBrain> + * The input buffer is never bigger than 0x6D60, so copy that, than we are
18:45:10 <TrueBrain> + * fine for sure. */
18:45:12 <TrueBrain> + arg06_csip = Tools_Malloc(0x6D60, 0x20);
18:45:13 <TrueBrain> + memcpy(emu_get_memorycsip(arg06_csip), arg06, 0x6D60);
18:45:15 <TrueBrain> would that work, I wonder :D
18:45:32 *** tneo- is now known as tneo
18:45:54 <TrueBrain> I am afraid it is pushing it, but ... I don't have better ideas :D
18:48:17 <glx> tv time
18:48:21 <TrueBrain> enjoy
18:48:50 <DorpsGek> SVN: truebrain (r2122) -Fix: don't show what we are excuting at 'make run', it is annoying :D
18:50:15 <DorpsGek> SVN: truebrain (r2123) -Add: move g_readBuffer out of g_global, hack around a csip in Driver_Voice_Play, and remove a few more Tools_Malloc
18:52:54 <TrueBrain> hmm, this is showing some odd thinges via valgrind
18:56:16 <DorpsGek> Bugs: http://bugs.opendune.org/view.php?id=78 :: Bug Created :: Game Crashes: [PCM] [022C] Not Yet Implemented D1
19:00:21 <TrueBrain> memory corruption .. that is odd ...
19:07:14 <DorpsGek> SVN: truebrain (r2124) -Fix (r2123): consistency
19:07:33 <DorpsGek> SVN: truebrain (r2125) -Fix: useless use of g_readBuffer, which also happens to be uninitialized in some cases
19:14:12 <DorpsGek> Bugs: http://bugs.opendune.org/view.php?id=78 :: New Status: feedback (open)
19:15:33 *** Alberth has left #openDune
19:18:23 <glx> [PCM] [022C] Not Yet Implemented D1 <-- that doesn't cause crashes
19:18:36 <TrueBrain> no, read the bug itself :)
19:18:40 <TrueBrain> just a bad subject :)
19:19:25 <TrueBrain> btw, did you read MrFlibbles post about broken VOC files?
19:22:03 <glx> I read it yes
19:22:19 <glx> about the bug, I cannot reproduce
19:22:32 <TrueBrain> did you try 0.5, or latest?
19:22:52 <glx> latest :) (of course 2903 is no longer here)
19:23:10 <TrueBrain> can you try with 0.5 tag?
19:23:33 <TrueBrain> I tried on linux, but it doesn't happen here ... might be because of voices
19:24:43 <glx> no crash
19:24:52 <TrueBrain> weird
19:26:01 <glx> it's in DrawSprite
19:26:13 <TrueBrain> yup, and to an offset that indicates some kind of damage
19:27:53 <glx> some code we never reached
19:28:00 <TrueBrain> well, check the offsets
19:28:02 <TrueBrain> they are odd
19:28:07 <TrueBrain> don't fit in with the others
19:29:55 <glx> 2441 is not in the array
19:30:09 <TrueBrain> so it looks like some buffer overflow
19:30:11 <TrueBrain> which is weird at this stage
19:30:41 <glx> hmm but we can't trust cs and ip
19:30:45 <TrueBrain> but I guess we should add an assert to avoid overflowing anyway
19:30:56 <TrueBrain> very good point
19:31:28 <TrueBrain> okay, that switch is weird
19:31:35 <TrueBrain> it only handles 2 of the possible 4
19:31:46 <TrueBrain> any idea why the others were never resolved?
19:32:09 <glx> IIRC I just used what was in decompiled
19:32:51 <TrueBrain> so indeed, for all we know that weird condition happened, and we just can't tell :D
19:33:28 <TrueBrain> that function needs love anyway, but brrr ... I don't want to touch it :D
19:35:11 <glx> 533 switch (emu_ip) {
19:35:11 <glx> 534 case 0x050E: f__2903_050E_0022_419A(); break;
19:35:11 <glx> 535 case 0x0545: f__2903_0545_0024_06E5(); break;
19:35:11 <glx> 536 default:
19:35:11 <glx> 537 /* In case we don't know the call point yet, call the dynamic call */
19:35:11 <glx> 538 emu_last_cs = 0x2903; emu_last_ip = 0x04B9; emu_last_length = 0x0018; emu_last_crc = 0x7352;
19:35:11 <glx> 539 emu_call();
19:35:13 <glx> 540 return;
19:35:13 <glx> 541 }
19:35:25 <glx> ok it'll need some work
19:35:30 * glx returns to tv :)
19:35:34 <TrueBrain> enjoy :D
19:37:53 <DorpsGek> SVN: truebrain (r2126) -Add: unify screenID segment/csip requests. [0] is identical to [1]
19:39:13 <glx> http://devs.opendune.org/~glx/2903_07A7.txt <-- I think I did check that, but as it never happened I just discarded it ;)
19:40:09 <DorpsGek> SVN: truebrain (r2127) -Fix: use wrappers instead of custom code when possible
19:40:22 <TrueBrain> yeah, we discarded more stuff; and it is okay :)
19:40:28 <TrueBrain> for all we know it can still be memory corruption
19:40:39 <TrueBrain> after all, the value can be 0..255, where only 8 entries are in the table
19:41:04 <glx> true
19:41:07 <TrueBrain> in general, the instruction pointers are weird
19:41:12 <TrueBrain> the first 4 are low, the next 4 are high
19:41:14 <TrueBrain> for all 3
19:41:17 <TrueBrain> which feels a bit off
19:42:56 <TrueBrain> but yeah, that function needs a good cleanup, de-duplication etc etc. And removing of the emu_ stuff :D
19:43:11 <TrueBrain> I am first going to try to resolve as many screen buffer usages as possible :P
19:48:13 <glx> maybe a side effect of r2010
19:48:53 <TrueBrain> possible
19:48:59 <TrueBrain> but then we should be able to reproduce I guess
19:50:17 <glx> g_global->variable_8DE3 |= values_32E4[orientation][1];
19:50:18 <glx> ...
19:50:18 <glx> GUI_DrawSprite(g_global->screenActiveID, sprite, x, y, 2, g_global->variable_8DE3 | 0x2000, g_global->variable_8420);
19:50:48 <glx> that's indeed a possible cause as 0.4 works
19:51:17 <TrueBrain> possible
19:51:21 <TrueBrain> then we need to force a release soon
19:51:27 <TrueBrain> either via backport or just a new release
19:51:28 <glx> and hard to reproduce because we need "luck" to have a breaking data there
19:52:55 <glx> oh I only tried gcc build
19:53:01 <glx> it seems msvc crashes
19:53:43 <TrueBrain> kewl; so you can tell us which value it has :D
19:53:56 <glx> yup
19:55:10 <glx> flags is 0xFFFF
19:55:20 <TrueBrain> lol
19:55:22 <TrueBrain> so you are right :)
19:55:29 <TrueBrain> does it still crash with latest trunk?
19:55:40 <DorpsGek> SVN: truebrain (r2128) -Add: use a wrapper to get screen buffer size
19:55:53 <glx> it can't crash with latest trunk
19:56:04 <TrueBrain> exactly what I want to know for sure :D
19:56:24 <TrueBrain> I know the code says it can't, just wanted to be sure :)
19:56:50 <glx> no crash
19:56:53 <TrueBrain> perfect :D
19:57:35 <TrueBrain> so, what do you think ..
19:57:41 <TrueBrain> do we want to push out a new version soon?
19:57:44 <TrueBrain> like 0.5.1?
19:57:55 <TrueBrain> because this is a real annoying bug ...
19:58:36 <glx> the problem is the bugs we may have added since the release
19:58:53 <TrueBrain> we can just backport this single revision
19:59:00 <TrueBrain> or we can just put it over 0.5, and re-release it
19:59:04 <TrueBrain> but that is not nice :P
19:59:07 <DorpsGek> Bugs: http://bugs.opendune.org/view.php?id=78 :: New Status: resolved (fixed)
19:59:26 <glx> there are also some bugs we fixed today
19:59:43 <TrueBrain> ugh, do we already start with backports :p One thing I never liked doing in OpenTTD :D
19:59:58 <TrueBrain> mostly because I can never remember what we did :p
20:00:29 <TrueBrain> okay, otherwise, lets put as goal to have libemu removed next week, so we can release 0.6 or something?
20:00:35 <TrueBrain> dunno if that is doable, with the sound stuff
20:00:48 <TrueBrain> AB00 and AB01 then need to be converted completely ...
20:00:48 <glx> with some hacks it can be
20:01:02 <TrueBrain> 3000 lines, pfff
20:01:23 <TrueBrain> many small routines
20:01:25 <TrueBrain> so that is good
20:01:36 <glx> by hacks I mean integrate libemu stuff inside AB00
20:01:43 <glx> to replace in/out calls
20:01:46 <TrueBrain> but emu_add etc is hard :P
20:02:08 <glx> true
20:02:25 <TrueBrain> I might spend tomorrow trying to convert it to C or something ...
20:02:39 <TrueBrain> or somewhere next week more likely :P
20:03:58 <TrueBrain> replacing screenID will be tricky ... I wonder what is the best way ...
20:04:10 <TrueBrain> we can either just give a pointer
20:04:13 <TrueBrain> Screen *screen
20:04:20 <TrueBrain> where we predefine a few
20:04:25 <TrueBrain> but that is not nice either
20:04:27 <TrueBrain> hmm
20:08:33 <TrueBrain> some smooth assuming the screens follow eachother up in memory ... WESTWOOD.WSA is loaded over 3 screens ..
20:08:34 <TrueBrain> lovely
20:09:42 <DorpsGek> SVN: truebrain (r2129) -Fix: some minor polishing
20:16:45 <DorpsGek> Bugs: http://bugs.opendune.org/view.php?id=78 :: New Status: feedback (reopened)
20:17:33 <DorpsGek> Bugs: http://bugs.opendune.org/view.php?id=78 :: New Status: closed (fixed)
20:23:24 <TrueBrain> wanna bet that flags 0 .. 3 are mirror states?
20:23:43 <TrueBrain> as in, 0 is horizontal, 1 is vertical, 0 is horizontal, but inverted, 2 is vertical, but inverted? :P
20:23:45 <TrueBrain> or something silly like that
20:29:24 <TrueBrain> http://devs.opendune.org/~truebrain/temp.patch <- to remove the emu_ in DrawSprite
20:29:28 <TrueBrain> not really pretty, but I think it is needed?
20:32:49 <TrueBrain> k, double checked, but value is indeed always below 4, never higher
20:33:17 <TrueBrain> and indeed it looks like it is rotation, so you need less sprites ;)
20:34:16 <glx> smart
20:35:47 <TrueBrain> yeah, when I flip the switch, things are indeed reversed :)
20:35:59 <TrueBrain> but that explains 0 and 1 .. not 2 and 3 tbh
20:36:51 <TrueBrain> 0 == 2, in every possible way, as far as I can tell :P
20:37:15 <TrueBrain> ah, no, something else changes then
20:37:31 <TrueBrain> k, fine
20:38:12 <DorpsGek> SVN: truebrain (r2130) -Add: removed a bunch of emu_ statements from DrawSprite, for cases that never happen, and never will happen
20:38:39 <TrueBrain> 1 emu_call left, in driver.c :)
21:01:44 <glx> it can be removed ;)
21:04:39 <DorpsGek> SVN: truebrain (r2131) -Codechange: replaced most csip routines around getting screenbuffers with GFX_Screen_Get_ByIndex() and friends (direct pointers)
21:04:50 <TrueBrain> 34 emu_get_memorycsip less
21:05:54 <DorpsGek> SVN: truebrain (r2132) -Fix (r2131): forgot one for some reason
21:16:03 <TrueBrain> lol
21:16:07 <TrueBrain> have you tried using the arrows lately? :D
21:16:15 <TrueBrain> you INSTANTLY move to the other side of the screen :D
21:16:58 <TrueBrain> hmm
21:16:59 <TrueBrain> text is wrong
21:17:04 <TrueBrain> it says: Sabatour approaching
21:17:08 <TrueBrain> where it should be Harkonnen
21:18:36 <DorpsGek> Bugs: http://bugs.opendune.org/view.php?id=79 :: Bug Created :: Wrong onscreen message 'approaching'
21:22:54 <TrueBrain> hmm, region selection doesn't work :(
21:25:45 <glx> http://svn.opendune.org/~glx/libemu.diff <-- does it work for you ?
21:27:11 <glx> hmm maybe I should trigger irq 7 directly
21:27:12 <TrueBrain> I wouldn't know why not; can't test if it really works, as no sound etc :)
21:27:24 <TrueBrain> no, the IRQ PIC is working just fine :)
21:27:24 <glx> I know that :)
21:27:49 <TrueBrain> although if you move it to OpenDUNE, you should of course call the function directly :)
21:29:28 <glx> but I hope these changes make it work on your no sound system
21:30:05 <glx> (while making pcm disablable)
21:30:13 <TrueBrain> make what work, sorry?
21:30:48 <glx> stop failing on first voice play
21:31:04 <TrueBrain> owh, I just disabled Sound ingame :D :D
21:31:05 <TrueBrain> hihi
21:31:15 <TrueBrain> will test in a bit, trying to find out why region clicking no longer works with my patch :(
21:32:31 <glx> hmm though I could test by just disabling pcm
21:32:38 <glx> the effect should be the same
21:33:17 <TrueBrain> select house 'hangs' for a bit
21:33:19 <TrueBrain> but then continues
21:33:21 <TrueBrain> so it is better :P
21:33:55 <DorpsGek> SVN: truebrain (r2133) -Add: moved out a few more variables from g_global
21:35:04 <DorpsGek> SVN: truebrain (r2134) -Add: another function bites the dust
21:40:18 <glx> of course voices are not really disabled :)
21:40:34 <DorpsGek> SVN: truebrain (r2135) -Add: and the last GFX_Screen_GetCSIP_ByIndex() references are now gone too
21:40:35 <glx> they still play, but silently
21:40:53 <TrueBrain> so there, that cleaned up a lot
21:40:58 <TrueBrain> from 100+ references down to 20-ish
21:41:18 <TrueBrain> now I hope I didn't break anything :D
21:42:26 <glx> diff updated, just to be sure no sdl audio function are called :)
21:43:36 <TrueBrain> still the same :)
21:43:49 <TrueBrain> hmm
21:43:52 <TrueBrain> now it hangs on Yes
21:44:01 <TrueBrain> so it is worse :p
21:44:08 <TrueBrain> when I click Yes, it just hangs
21:44:15 <glx> that happens with working sound sometimes :)
21:44:31 <TrueBrain> happens consistent
21:44:52 <TrueBrain> but not when I attach gdb
21:44:54 <TrueBrain> lolz
21:45:05 <TrueBrain> ah, it does
21:45:11 <TrueBrain> Driver_Voice_IsPlayer()
21:45:15 <TrueBrain> emu_DSP_GetStatus()
21:45:24 <glx> confirmed
21:45:24 <TrueBrain> so I guess one of the functions sets a bit back to indicate it is done?
21:45:34 <TrueBrain> anyway
21:45:35 <TrueBrain> much better is
21:45:39 <TrueBrain> that is the init fails
21:45:43 <TrueBrain> to stop doing it at all :P
21:45:45 <glx> hmm but it continues after some times
21:49:08 <DorpsGek> SVN: truebrain (r2136) -Fix: minimalize the screenbuffer stuff a bit more
21:49:44 <TrueBrain> @calc 0xFA00
21:49:44 <DorpsGek> TrueBrain: 64000
21:49:53 <TrueBrain> @calc 0xFD0D
21:49:54 <DorpsGek> TrueBrain: 64781
21:49:57 <TrueBrain> @calc 0xFBF4
21:49:57 <DorpsGek> TrueBrain: 64500
21:50:01 <TrueBrain> @calc 0xA044
21:50:01 <DorpsGek> TrueBrain: 41028
21:50:05 <TrueBrain> 2 weird numbers :P
21:52:03 <DorpsGek> SVN: glx (r2137) [LibEMU] -Add: make PCM externally disablable
21:56:31 <DorpsGek> SVN: truebrain (r2138) -Codechange: final pieces to move the screenBuffer stuff to a single place
22:02:28 <DorpsGek> SVN: truebrain (r2139) -Add: removed screenActiveID from g_global and unified his wrappers (and use)
22:03:45 <DorpsGek> SVN: truebrain (r2140) -Fix: forgot to mark the variables as removed
22:05:09 <DorpsGek> SVN: truebrain (r2141) -Add: removed a read-only value, replaced with hard-coded value.
22:05:41 <TrueBrain> down to under a 100 emu_ references ... :D:D:D
22:11:57 <DorpsGek> SVN: truebrain (r2142) -Fix: valgrind indicates GFX_Screen_Copy can overlap in memory, so use memmove, not memcpy
22:12:47 <DorpsGek> SVN: truebrain (r2143) -Add: switch the screenbuffers to 32bit/64bit pointers. 0xA000 is no longer the screen buffer
22:12:57 <TrueBrain> the last 20 commits all leading up to r2143 ...
22:12:59 <TrueBrain> what a world
22:13:37 <TrueBrain> so now official, driver.c is the only one with 16bit mallocs left :D
22:14:12 <TrueBrain> I hope nothing weird happens now, but I did my best to check indepth that all pointers were safe to be switched :)
22:18:23 <TrueBrain> animation is now the number 1 user of emu_get_memorycsip .. that will be a bitch to get out the 16bit world :P
22:19:24 <TrueBrain> right; enough for today
22:19:27 <TrueBrain> I wish you a good ngiht :)
22:23:08 <glx> night :)