Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - c-square

Pages: [1]
1
SCI Syntax Help / Re: Memory Fragmentation in QFG2
« on: November 19, 2017, 12:40:59 AM »
Actually, I meant this:
Woah!  I have no clue how to bring that up.  Please let me know how you did that.

2
AGI Syntax Help / AGI Random Number Generator
« on: November 19, 2017, 12:38:22 AM »
Hi,

I'm trying to crack the RNG behind the slot machine in SQ1 to help someone with a TAS of the game.  We've found the code for NAGI's random function:
Code: [Select]
       u16 diff;
       u16 min;
       u16 max;
       
       min =  *(c++);
       max = *(c++);
       diff = max - min +1;
       state.var[*(c++)] = (agi_rand() % diff) + min;
       return c;

where agi_rand() calls:

Code: [Select]
   if (agi_rand_seed == 0)
        {
              //printf("Creating new randomised seed...\n");
              /* ah = 0; int(1Ah); */     // number of ticks since midnight
#ifndef RAD_LINUX
              _ftime (&t);         // time since 1970 but that's ok
#else
              ftime(&t);
#endif
              //printf("time = %ld seconds %ld milliseconds\n", t.time, t.millitm );
              agi_rand_seed = t.time * TANDY_CLOCK_PER_SEC;
              agi_rand_seed += (u16) ((double)t.millitm  / 1000 * TANDY_CLOCK_PER_SEC);
              //printf("seed = 0x%04X\n\n", agi_rand_seed);
       }

        agi_rand_seed = 0x7C4D * agi_rand_seed + 1;
       r = agi_rand_seed ^ (agi_rand_seed>>8);
        return( r );

and this seems to be correct some of the time, but not always.  JAGI seems to have a completely different function.

Does anyone know how I can find out the random logic used in the actual AGI interpreter?

3
SCI Syntax Help / Re: Memory Fragmentation in QFG2
« on: November 01, 2017, 09:44:27 PM »
Hi lskovlun,

Here's the code that's causing the issue:

Code: [Select]
(if (u> (MemoryInfo 1) (+ 20 (MemoryInfo 0)))
If that triggers, it gives the error message.

MemoryInfo 1 is the free heap.  MemoryInfo 0 is the largest ptr.  I don't understand what u> is, so I don't know what kind of comparison it's looking for.

I don't know how to use 'f' to get to the debugger.  The only debug mode I can seem to access is the one you get by typing "Suck Blue Frog".

I tried jumping to the end to create a save file, however it doesn't load the save file properly, so I'm out of luck on that account.

Cheers!

Pages: [1]

SMF 2.0.14 | SMF © 2017, Simple Machines
Simple Audio Video Embedder

Page created in 0.084 seconds with 22 queries.