atoone / beastem Goto Github PK
View Code? Open in Web Editor NEWMicroBeast Z80 Computer emulator
License: zlib License
MicroBeast Z80 Computer emulator
License: zlib License
When built on macOS, I found that the emulator starts up emitting audio noise and cannot be stopped without exiting.
I observed this behaviour on macOS Ventura, on both Intel and Apple Silicon Macs.
SDL 2 installed from Homebrew in both cases (for the appropriate arch). Versions below (from Intel, but my M1 environment is equivalent).
# cc --version
Apple clang version 15.0.0 (clang-1500.1.0.2.5)
Target: x86_64-apple-darwin22.6.0
Thread model: posix
# sdl2-config --version --cflags --libs
2.30.0
-I/usr/local/include/SDL2 -D_THREAD_SAFE
-L/usr/local/lib -lSDL2
1.1 Can't run the beastem until I move to
cd \assets
.\beastem
1.2 Run but with a lot of noise and I have to turn off my speaker.
But it seems to detect correctly all the devices:
No file or listing arguments, loading demo firmware
Parsed listing, file firmware.lst for page 0 has 4290 lines.
Parsed listing, file monitor.lst for page 35 has 5764 lines.
Read file 'flash_v1.5.bin' (241K) to ROM starting at 0x0
Clock cycle time ps = 125000, speed = 8.00MHz
UART init. Clock rate 1843200
Divisor 1 Baud rate : 115200
2024-03-06 22:11:09.507 beastem[82979:39105566] INFO: Audio device 0: G34WQC A
2024-03-06 22:11:09.507 beastem[82979:39105566] INFO: Audio device 1: Dell AC511 USB SoundBar
2024-03-06 22:11:09.507 beastem[82979:39105566] INFO: Audio device 2: BlackHole 16ch
2024-03-06 22:11:09.507 beastem[82979:39105566] INFO: Audio device 3: External Headphones
2024-03-06 22:11:09.507 beastem[82979:39105566] INFO: Audio device 4: Mac mini Speakers
2024-03-06 22:11:09.507 beastem[82979:39105566] INFO: Audio device 5: Record It Audio Device
2024-03-06 22:11:09.507 beastem[82979:39105566] INFO: Audio device 6: ZoomAudioDevice
2024-03-06 22:11:09.507 beastem[82979:39105566] INFO: Audio device 7: Record It Aggregate Device
and not sure how to proceed (change firmware.lst?) :
1.3 bios.lst
I cannot see any bios.lst in the macOS asset directory. The default should not run but it did.
1.4 Did try to run the other firmware-p24.bin
../beastem -l 0 ../firmware_p24.bin
It sort of the same issue, noise on the speaker. And the similar image
and a bit longer console log
No match on line 1
No match on line 2
No match on line 3
No match on line 9
No match on line 12
No match on line 15
No match on line 17
No match on line 18
No match on line 20
No match on line 23
No match on line 25
No match on line 31
No match on line 33
No match on line 34
No match on line 35
No match on line 37
No match on line 38
No match on line 39
No match on line 40
No match on line 41
No match on line 42
No match on line 43
No match on line 45
No match on line 48
No match on line 49
No match on line 50
Parsed listing, file ../firmware_p24.bin for page 0 has 50 lines.
Clock cycle time ps = 125000, speed = 8.00MHz
UART init. Clock rate 1843200
Divisor 1 Baud rate : 115200
2024-03-06 22:18:39.578 beastem[83074:39110102] INFO: Audio device 0: G34WQC A
2024-03-06 22:18:39.578 beastem[83074:39110102] INFO: Audio device 1: Dell AC511 USB SoundBar
2024-03-06 22:18:39.578 beastem[83074:39110102] INFO: Audio device 2: BlackHole 16ch
2024-03-06 22:18:39.578 beastem[83074:39110102] INFO: Audio device 3: External Headphones
2024-03-06 22:18:39.578 beastem[83074:39110102] INFO: Audio device 4: Mac mini Speakers
2024-03-06 22:18:39.578 beastem[83074:39110102] INFO: Audio device 5: Record It Audio Device
2024-03-06 22:18:39.578 beastem[83074:39110102] INFO: Audio device 6: ZoomAudioDevice
2024-03-06 22:18:39.578 beastem[83074:39110102] INFO: Audio device 7: Record It Aggregate Device
1.5 How to proceed next stage
Also, not sure how to proceed after this (how to add/change to a proper Z80 CPU, how to run a Z80 assembler program ...).
brew install sdl2 sdl_2gfx sdl2_image sdl2_net sdl2_ttf
but it should be sdl2_gfx not sdl_2gfx or
brew install sdl2 sdl2_gfx sdl2_image sdl2_net sdl2_ttf
make clean all
rm -f beastem beastem.o src/i2c.o src/beast.o src/digit.o src/display.o src/rtc.o src/debug.o src/listing.o src/instructions.o src/videobeast.o
c++ -I/Users/xxxxxx/miniconda3/include/SDL2 -D_THREAD_SAFE -std=c++20 -O2 -c -o beastem.o beastem.cpp
beastem.cpp:5:10: fatal error: 'SDL_net.h' file not found
#include <SDL_net.h>
^~~~~~~~~~~
1 error generated.
The problem is conda run in default and need to be turn off
conda config --set auto_activate_base false
I have a Swedish keyboard, and I can't find the ":" anywhere.
This makes it impossible to write "STAT CON:=BAT:"
It seem to be connected to the physical keyboard, it doesn't help if I switch to English in the OS.
Would it be possible to have some kind of shortcut in the emulator to switch terminal?
OS: Linux, tried on both Raspbian and Ubuntu
After installing SDL2 using brew install sdl2 sdl2_gfx sdl2_ttf
and compiling it manually as
g++ \
-O3 -w -g -std=c++14 \
*.cpp \
src/*.cpp \
-I/opt/homebrew/include/SDL2/ \
-L/opt/homebrew/lib/ \
-lSDL2 \
-lSDL2_ttf \
-lSDL2_gfx-1.0.0
I can run it, but it looks a bit wonky with two small frames stacked onto each other in a large window. It was super long ago since I did anything myself with SDL but I could probably dig around a bit and see. Can you add a screenshot to the readme of how it is supposed to look like?
Directly after starting the emulator, with the bios loaded, the CPU load is about 50% on a single core of an M1. When the emulator clock is started, set to the default 8MHz, the core is pegged at 100%, the entire window get really sluggish (takes several seconds to mark keypresses on the softkeyboard). Then after a while the MacOS busy-indicator pinwheel of death is shown.
There must be some tight busy-polling loop going on in the code...
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.