Giter VIP home page Giter VIP logo

smalltalk's Issues

Question about snapshot code hitting asserts :-)

Hi Dan,

This is most assuredly not an issue with this codebase but seemed like a decent way to get in touch. I've been working with a friend on trying to implement a blue book Smalltalk in C for the Amiga computer. I confess I have joined the project late and have been cargo-culting a bit over there and occasionally looking to your excellent project for a clue when I get confused. I recently started working on a way to load and save an image (we have a mostly functional ObjectMemory but no interpreter really yet). I've pretty much been trying to work from your code and I think I have it basically working - loading and saving the ST80 image you linked to.

One question I have though... I hit the assert ( https://github.com/dbanay/Smalltalk/blob/master/src/objmemory.cpp#L119 ) that's designed to stop a zero-counted object being loaded, and I hit it a few times. If I disable that assert and just load the image anyway, it all seems to work fine (as I say, no interpreter, so all I can really say is we end up with a basically intact ObjectMemory).

Screenshot 2020-12-23 at 21 44 28

So I guess my question is if you load that tape image with your code, I'm puzzled why the assert doesn't fire and I wonder if I've done something wrong somewhere. 🤔

Thanks for your time,

Alan

Bit of a hint for MacOS compilation

Not really an issue, but I had some struggles last night with building this for MacOS so I thought I'd let you know in case you wanted to update the documentation. I'm terrible at C++ so it may well have been my fault.

The Makefile was using sdl2-config --cflags to add -L/opt/homebrew/include/SDL2 to the include path. This wasn't working - I'm assuming because #include "SDL2/SDL.h" was trying to look for an SDL2 directory inside SDL2. I changed the flag to -L/opt/homebrew/include and it compiled and ran just fine.

As I say, might just be me doing something else wrong 🤷.

Really looking forward to going through the blue and red books using this - thank you so much!

Unable to compile under Fedora 28

I checked I had SDL2-devel installed, I do.

bash$ rpm -qa | grep SDL
...
SDL2-devel-2.0.9-1.fc28.x86_64 <<< I think I done something bad....>>>
...
I suspect I missed something in the Readme.txt (I did).

I grabbed the most recent revision I could find of Smalltalk here: 8fc5c39
bash:/home/viking/src/smalltalk/ST80 $ git clone https://github.com/dbanay/Smalltalk
...

I tried retrieving the current revision from git:
bash:/home/viking/src/smalltalk/ST80/Smalltalk $ git describe
fatal: no names found, cannot describe anything

I then tried to make the project:
bash:/home/viking/src/smalltalk/ST80/Smalltalk/linux $ make
g++ -std=c++17 -O3 -c ../src/objmemory.cpp -o objmemory.o
g++ -std=c++17 -O3 -c ../src/bitblt.cpp -o bitblt.o
g++ -std=c++17 -O3 -c ../src/main.cpp
../src/main.cpp:58:14: error: 'SDL_PixelFormatEnum' does not name a type; did you mean 'SDL_PixelFormat'?
static const SDL_PixelFormatEnum TextureFormat = SDL_PIXELFORMAT_RGB565;
                                 ^~~~~~~~~~~~~~~~~~~
                                 SDL_PixelFormat
../src/main.cpp: In member function 'virtual bool VirtualMachine::set_display_size(int, int)':
../src/main.cpp:374:51: error: 'TextureFormat' was not declared in this scope
         texture = SDL_CreateTexture(renderer, TextureFormat, SDL_TEXTUREACCESS_STREAMING, display_width, display_height);
                                               ^~~~~~~~~~~~~
../src/main.cpp:374:51: note: suggested alternative: 'SDL_FreeFormat'
         texture = SDL_CreateTexture(renderer, TextureFormat, SDL_TEXTUREACCESS_STREAMING, display_width, display_height);
                                               ^~~~~~~~~~~~~
                                               SDL_FreeFormat
make: *** [Makefile:11: main.o] Error 1
bash$

So, where do I go from here? I don't really have the ability to upgrade my Fedora to the latest version at the moment.

Regards, brickviking

Kudos

This is really neat.

Launched like a charm on macOS once this, in osx/Makefile:

SDL_CFLAG := $(shell sdl2-config --cflags)

was replaced by that:

SDL_CFLAG := $(shell sdl2-config --cflags | sed 's/\/SDL2//')

Thanks!

Installation instructions for Linux needs adjustements

Hi Dan,

First of all what a fantastic job you have done. Really! I always dreamt of running the original ST-80 images again.... You made my deram come true.

One minor adjustement in the installation instructions for Linux. Here is what I did:

$ git clone repo
$ cd Smalltalk
$ ./configure
-bash: ./configure: No such file or directory
$ cd linux
$ make
$ make install
make: *** No rule to make target 'install'.  Stop.
$ ./Smalltalk 

it opens Smalltalk 80 just fine!! Yeah...

So in other words I could not run ./configure, nor make install on Linux.

Besides on my Debian distro you can also simply install the SDL 2 dev package and it works fine
$ sudo apt install libsdl2-dev

Having trouble with BitBlt::RightMasks at link time

I presume this is some fistfight regarding constexpr and someone is confused if it is resolved at compile time vs. needs to be resolved. I'll mess with it and see if I can figure it out.

~/Source/OpenSource/Smalltalk/osx$ gcc --version
Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/c++/4.2.1
Apple LLVM version 10.0.1 (clang-1001.0.46.4)
Target: x86_64-apple-darwin18.7.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
~/Source/OpenSource/Smalltalk/osx$ make
g++  -O3 -std=c++14 -c ../src/objmemory.cpp  -o objmemory.o
g++  -O3 -std=c++14 -c ../src/bitblt.cpp  -o bitblt.o
g++  -O3 -std=c++14 -I/Library/Frameworks/SDL2.framework/Headers -F/Library/Frameworks   -c ../src/main.cpp
g++  -O3 -std=c++14 -c ../src/interpreter.cpp  -o interpreter.o
g++  -F/Library/Frameworks -framework SDL2  -o Smalltalk  objmemory.o bitblt.o main.o interpreter.o
Undefined symbols for architecture x86_64:
  "BitBlt::RightMasks", referenced from:
      BitBlt::computeMasks() in bitblt.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [Smalltalk] Error 1

Eating all CPU

Hi Dan,

I also noticed that once Smalltalk is running it keeps eating almost 100% of the CPU. I guess there must be some kind of event polling loop running forever, right ?

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.