Author Topic: Script patch files  (Read 1793 times)

0 Members and 1 Guest are viewing this topic.

Offline doomlazer

Re: Script patch files
« Reply #75 on: October 03, 2021, 09:56:37 PM »
That's right. SNDBLAST.DRV not only has stereo sound, but digital audio as well, which I've added from the Amiga version.

I see 607 & 608 are day/night additions to the forest below the ogre's house. That's pretty cool. Do the digital sounds require the 0.000.685 interpreter or is that also supported on .502 with the adlib drivers?

If you want to send a link to a new build I'll test some more. I didn't finish the first run because of the timer.

Offline Collector

Re: Script patch files
« Reply #76 on: October 04, 2021, 12:05:34 AM »
Of course.
KQII Remake Pic

Offline doomlazer

Re: Script patch files
« Reply #77 on: October 04, 2021, 02:01:38 AM »
So... would a short speech sample be possible in KQIV? I couldn't find a way to import a .wav into a SCI0 game.

Unrelated, I'm running into a problem testing the AGI Easter port and SCUMMVM. Scumm doesn't like me using the sq1Window class. The attached pic shows that the box correctly positioned, but the text doesn't seem to get the Print's #at posn. Everything works as expected with dosbox.
« Last Edit: October 04, 2021, 02:05:19 AM by doomlazer »

Offline Kawa

Re: Script patch files
« Reply #78 on: October 04, 2021, 04:02:42 AM »
Wrong port -- the Dialog class that Print ends up using expects that the current port is whatever window it's supposed to draw to. sq1Window switches from the window port to the screen port so it can freely draw the border, but then doesn't switch back, so the Dialog ends up drawing on the screen port as well. This is actually one of the effects described in my blog post about sq1Window:


Speech samples are technically possible, after all SQ4 is an SCI0 game (if it's not the multi-language release) and it has samples ("Where am I?") but you'll need a third party tool to create a Sound resource with a "digital" track, as opposed to an Audio resource.

Offline doomlazer

Re: Script patch files
« Reply #79 on: October 04, 2021, 07:45:27 AM »
Hmm, I followed your blog post pretty closely, but I'm still missing something. I'll sleep on it, but it still seems weird it's working perfectly in dosbox, just not scummvm. Here is my sq1Window class incase anything obvious jumps out.

Code: [Select]
(class Sq1Window of SysWindow
  (properties
    underBits 0
    pUnderBits 0
    bordWid 3
  )
 
  (method (dispose)
    (SetPort 0)
    (kernel_112 grRESTORE_BOX underBits)
    (kernel_112 grRESTORE_BOX pUnderBits)
    (kernel_112 grREDRAW_BOX lsTop lsLeft lsBottom lsRight)
    (super dispose:)
  )
 
  (method (open &tmp port temp1)
    (= color 0) ;gColor)
    (= back 15) ;gBack)
    (= type 128)
 
  ` (super open:)
    (= port (SetPort 0))
 
    (= temp1 1)
    (if (!= priority -1) (= temp1 (| temp1 $0002)))
    (= lsTop (- top bordWid))
    (= lsLeft (- left bordWid))
    (= lsRight (+ right bordWid))
    (= lsBottom (+ bottom bordWid))
    (= underBits (kernel_112 grSAVE_BOX lsTop lsLeft lsBottom lsRight 1))
    (if (!= priority -1)
      (= pUnderBits (kernel_112 grSAVE_BOX lsTop lsLeft lsBottom lsRight 2))
    )
    ; Draw the background
    (kernel_112 grFILL_BOX lsTop lsLeft lsBottom lsRight temp1 back priority)
    ; Draw the border
    (kernel_112 grDRAW_LINE (+ lsTop 1) (+ lsLeft 1) (+ lsTop 1) (- lsRight 2) 4 priority) ;global131 priority)
    (kernel_112 grDRAW_LINE (- lsBottom 2) (+ lsLeft 1) (- lsBottom 2) (- lsRight 2) 4 priority)
    (kernel_112 grDRAW_LINE (+ lsTop 1) (+ lsLeft 1) (- lsBottom 2) (+ lsLeft 1) 4 priority)
    (kernel_112 grDRAW_LINE (+ lsTop 1) (- lsRight 2) (- lsBottom 2) (- lsRight 2) 4 priority)
    (kernel_112 grUPDATE_BOX lsTop lsLeft lsBottom lsRight 1)
   
    (SetPort port)
  )
)

Offline Kawa

Re: Script patch files
« Reply #80 on: October 04, 2021, 08:58:14 AM »
Why is there a ` in front of your (super open:) call?

Offline doomlazer

Re: Script patch files
« Reply #81 on: October 04, 2021, 11:52:22 AM »
I don't know how that got in there, but it's not in any of the compiled code.

I replaced my sq1Window code with sierra's version and it display's the text in the correct location through SCUMMVM, but with all the issues outlined in your blog post. I'll spend some time later testing to see if I can make SCUMMVM happy with your improved version of sq1Window somehow. Worst case, I guess I could use sierras dirty version of the windows, but it definitely doesn't looks as good as your fix. 

Offline doomlazer

Re: Script patch files
« Reply #82 on: October 05, 2021, 08:05:19 PM »
Just in case anyone uses the sq1Window class again, (= port (SetPort 0)) needs to be changed to work correctly in SCUMMVM:

Code: [Select]
(= port (GetPort))
(SetPort 0)

Here is the complete sq1Window class with Kawa's fix and the SCUMMVM fix:

Code: [Select]
(class Sq1Window of SysWindow
  (properties
    underBits 0
    pUnderBits 0
    bordWid 3
  )
 
  (method (dispose)
    (SetPort 0)
    (kernel_112 grRESTORE_BOX underBits)
    (kernel_112 grRESTORE_BOX pUnderBits)
    (kernel_112 grREDRAW_BOX lsTop lsLeft lsBottom lsRight)
    (super dispose:)
  )
 
  (method (open &tmp port temp1)
    (= color 0)
    (= back 15)
    (= type 128)
    (super open:)
    ;(= port (SetPort 0))
    (= port (GetPort))
    (SetPort 0)
    (= temp1 1)
    (if (!= priority -1) (= temp1 (| temp1 $0002)))
    (= lsTop (- top bordWid))
    (= lsLeft (- left bordWid))
    (= lsRight (+ right bordWid))
    (= lsBottom (+ bottom bordWid))
    (= underBits (kernel_112 grSAVE_BOX lsTop lsLeft lsBottom lsRight 1))
    (if (!= priority -1)
      (= pUnderBits (kernel_112 grSAVE_BOX lsTop lsLeft lsBottom lsRight 2))
    )
    ; Draw the background
    (kernel_112 grFILL_BOX lsTop lsLeft lsBottom lsRight temp1 back priority)
    ; Draw the border
    (kernel_112 grDRAW_LINE (+ lsTop 1) (+ lsLeft 1) (+ lsTop 1) (- lsRight 2) 4 priority) ;4 was global131 linecolor
    (kernel_112 grDRAW_LINE (- lsBottom 2) (+ lsLeft 1) (- lsBottom 2) (- lsRight 2) 4 priority)
    (kernel_112 grDRAW_LINE (+ lsTop 1) (+ lsLeft 1) (- lsBottom 2) (+ lsLeft 1) 4 priority)
    (kernel_112 grDRAW_LINE (+ lsTop 1) (- lsRight 2) (- lsBottom 2) (- lsRight 2) 4 priority)
    (kernel_112 grUPDATE_BOX lsTop lsLeft lsBottom lsRight 1)

(SetPort port)
  )
)


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

Page created in 0.195 seconds with 23 queries.