Coder Social home page Coder Social logo

lba1-classic's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

lba1-classic's Issues

Memory error in Load_HQR

First off, thank you for releasing the original source code. I was trying to compile this code, and found some memory errors regarding the HQR uncompressing methods. These methods receive a pointer which is assumed to have enough space to hold both the compressed and uncompressed data. This is achieved by adding some empty space to several prereserved global arrays which will load their data from compressed files. However, that is just a quick patch and some arrays are too small, which renders a memory error. The one that i found is in the file "HQ_RESS.C" line 132, but it is a common issue found all along this library (or along several global arrays). The method that loads the "Adeline logo" data writes directly to the "Screen" global array (640*480 +500 bytes), and after reading the uncompressed data the program "should end" (i found this error running Valgrind memcheck, it actually runs in a normal environment ). The code shows as follows:

line HQ_RESS.C:131

case 1: /* LZS /
ptrdecomp = (UBYTE
)ptrdest + header.SizeFile - header.CompressedSizeFile + RECOVER_AREA ;
Read( handle, ptrdecomp, header.CompressedSizeFile ) ;
Expand( ptrdecomp, ptrdest, header.SizeFile ) ;
break ;

  • ptrdest is a pointer to some previously reserved memory (the programmer should know the uncompressed size of the data before calling this method).
  • ptrdecomp should be a pointer to a memory area of "header.CompressedSizeFile" bytes, but it uses the same ptrdest to save some memory.
    The solution is to create an auxiliar pointer, load the compressed data, and call "expand" to uncompress it (assuming ptrdecomp has enough space).

case 1: /* LZS /
ptrdecomp = (UBYTE
) Malloc(header.CompressedSizeFile ) ;
Read( handle, ptrdecomp, header.CompressedSizeFile ) ;
Expand( ptrdecomp, ptrdest, header.SizeFile ) ;
Free(ptrdecomp);
break ;

That error is spreaded along the HQ_RESS.c file on some other methods that calls "Expand". Also that should save some memory on several global arrays that don't need that extra space.

I'm not sure if i should make a patch for this code, as it is "legacy". But i think it should be documented somewhere. I was rewritting several parts in order to make a more portable code based on the original sources, so i'll try to check all the memory leaks/errors I find.

Thank you

Thank you. That's all I wanted to say.

(If anyone else wants to express gratitude, feel free to add a heart emoticon to this post, instead of adding more comments).

Unable to compile

Version

  • OS: Debian 11
  • DosBox 0.74-3
  • 4DOS v8.00
  • MASM 6.0
  • Watcom CPP 10.5
wmake
WATCOM Make Version 10.5
wcc386
WATCOM C32 Optimizing Compiler Version 10.5
ml
Microsoft (R) Macro ASsembler Version 6.00

Dosbox.conf file:

[autoexec]
keyb fr
MOUNT C "/home/src386/DosBox"

PATH c:\watcom\binw;c:\masm\bin;%PATH%
set INCLUDE=c:\watcom\h;c:\lba1\lib386
set WATCOM=c:\watcom
set EDPATH=c:\watcom\eddat
set WIPFC=c:\watcom\wipfc

C:
C:\4DOS\4DOS.COM

Steps to reproduce

cd LBA1
cd LIB386
cd LIB_3D
wmake

Expected result

Compilation should work

Actual result

WATCOM Make Version 10.5
Copyright by WATCOM International Corp. 1988, 1995. All rights reserved.
WATCOM is a trademark of WATCOM International Corp.
Error(E14): Cannot execute (PRNTITRE): No such file or directory
Error(E42): Last command making (p_sintab.obj) returned a bad status
Error(E02): Make execution terminated

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.