Previous journal: | Next journal: |
---|---|
0060-2022-11-23.md | 0062-2023-04-17.md |
- Get my website going again. Some of the things that become notes here could be articles at https://ammauro.com instead. I had done some work somewhere (maybe in a VM on my desktop computer, not yet committed??) on improving its presentation (modern HTML5/CSS, etc?) after I upgraded it for newer Linux and Ruby platforms.
- DONE: Make a shell script for creating new journal entries in this repo. - Run
make new
or justmake
. - DONE: Fix mouse wheel in Ubuntu 20 Desktop VM, in VirtualBox, on Windows host.
- Prep a TinyTapeout 03 (TT03) submission based on solo_squash. Cutoff is 23 Apr 2023!
- I've been studying Zero to ASIC Course.
- My base design: solo_squash - simple VGA game resembling 1-player Pong.
- Wrapped in Caravel: solo-squash-caravel - i.e. for Google Skywater Open MPW program.
- Registered with Efabless. Waiting on Google-sponsored MPW9 to open. I want to do a much bigger/better design for this though. Ideally a real-time ray-caster (e.g. Wolf3D-style renderer).
- Working on getting back into 2D ray-casting:
- Goal is to make a hardware-based Wolf3D-style renderer.
- I'm figuring out algorithms in C++ first: raybox-app
- Then I'll try the equivalent in Verilog: raybox
- Rendering GDS files with Blender
- OpenRAM Playground on Google Colab.
- Custom standard cells in SKY130
- efabless/caravel_board
- kbeckmann's notes about clocks in Caravel
- caravel_vsd_priority_encoder -- Great example of a Caravel project's README
- Project F: Various FPGA graphics/maths things
- 8bitworkshop stuff - rotating texture demo in Silice.
- FPGA/Verilog tutorial targeting a simple CPU
- I want to adapt solo_squash to work with Tiny Tapeout 3.
- This will be an HDL-based submission.
- Things to work out:
- What's the size that the submission must be? 150x170um?
- Should I add any extra features to the design if we have spare room?
- What's the maximum clock speed, and max speed of IOs?
- Is there a clock already provided, or is it one of the inputs?
- Given we have 8 inputs, and 8 outputs, what should we use these for?
- Inputs:
- Up
- Down
- Reset?
- Clock??
- Optional: New game
- Optional: Pause
- Unused
- Unused
- Outputs:
- HSYNC
- VSYNC
- R
- G
- B
- Optional: Speaker
- Debug reset out?
- Debug GPIO ready out?
- Inputs:
- Can we replace the firmware for this chip?
- tinytapeout-03 is where all designs are being aggregated into a main caravel project.
- With only 1 week to submit, I may not make it to TT03 because:
- Max. clock speed seems to be about 12.5kHz at this point. Maybe more, but not likely to improve until TT04.
- Hence, I can't do anything at VGA clock speeds.
- Any other designs that are useful/interesting at this low speed? What about BFCPU or some other CPU design?
- Watch this video on working with HDLs for TT03.
- Template project for HDL appears to be: tt03-verilog-demo
- Good info on testing that might apply more generally.
- My aim is to make hardware (FPGA or ASIC) that can accelerate some or all of the rendering for a simple ray-casting (i.e. Wolf3D-style) game.
- Intended specs:
- Directly drive a VGA display at 320x200, 320x240, or 640x480 resolution.
- Use at least 2 bits per RGB channel, but preferably full 24-bit colour. 1-bit per channel can sort of work (e.g. blue on H walls, cyan on V walls) but would probably look crappy enough to break the effectiveness of how this looks.
- Motion control and collision detection?
- Sprites?
- 64x64 map, or map checking comes from other logic or external memory/device?
- Flat wall colours first, maybe textures later?
- If we can't do real-time tracing, we could do it during VBLANK, or just double-buffer it.
- raybox-app has some early clunky C++ code that does basic 2D ray casting by DDA
- DDA is Digital Differential Analysis (or Digital Differential Analyzer).
- My original reference was: https://lodev.org/cgtutor/raycasting.html
- My heavily-commented reworking of the DDA algorithm used for wall-map-distance ray casting is here.
- DDA on Wikipedia.
- Bresenham's line algorithm.
- EFLA (Extremely Fast Line Algorithm).
- Fixed-point functions
- Fixed-point ray casting
- Other examples of ray-casting and related stuff:
- Game Engine Black Book - Wolfenstein 3D by Fabien Sanglard. Actual PDF here of the WOLF book
- Sylvain Lefebvre's work on FPGA ray casting
- Wolf3D ported to SDL
- Partial FPGA implementation inc. fixed-point maths?
- raycaster-sdl
- JS raycasting tutorial on GitHub
- Anarch
- More discussion about different raycasting techniques
- A paid tutorial
- JS tutorial building on lodev tutorial inc. with dors.
- FPGA racing-the-beam ray TRACER.
- Ideas:
- When later implementing in Verilog, in order to avoid costly division circuits, is there a way we can simultaneously calculate both the distance and the respective height of the wall column to render, embedded within the DDA loop? I could imagine a way to start with a reference height or initial height, and then subtract a progressively-decreasing number with each step.
- An alternative is to have a lookup table that can convert different ranges of input values to known integer height outputs; such a table would have (at most) 240 entries, except where taller-than-screen values are required.
- Will it work OK, though, with fixed-point maths? Wikipedia DDA article touches on it.
Ubuntu 20.04 LTS Desktop VM, in VirtualBox, on a Windows host.
It's a common problem in VirtualBox, with a Linux guest using a GNOME (?) desktop environment, that mousewheel events get discarded while the pointer is moving. There are lots of proposed solutions to this, but below is what worked for me.
This borrows info from here and here, mostly, and with a little modification.
- Powered off the VM, and go into VM settings.
- General → Advanced: Disable Drag'n'Drop
- System → Pointing Device: PS/2 Mouse
- Power on, then
sudo apt install imwheel
- Create
~/.imwheelrc
:"^.*$" None, Up, Button4, 2 None, Down, Button5, 2 Shift_L, Up, Shift_L|Button4, 2 Shift_L, Down, Shift_L|Button5, 2 Control_L, Up, Control_L|Button4 Control_L, Down, Control_L|Button5
- Run
imwheel -b "4 5"
-- it should background itself.- Verify that mousewheel works, now, while moving the pointer in VSCode and Firefox.
- To make this permanent, make an autostart desktop entry:
-
cd ~ mkdir -p .config/autostart
- Create
.config/autostart/imwheel.desktop
:# This fixes the mousewheel while the pointer is moving. # See: https://github.com/algofoogle/journal/blob/master/0061-2023-04-16.md#fixing-mouse-wheel-in-ubuntu-20-desktop-vm [Desktop Entry] Type=Application Name=imwheel # The given -b option restricts this to the wheel and avoids breaking the side buttons. Exec=imwheel -b "4 5" StartupNotify=false Terminal=false
- Reboot.
-
- Run
ps -fA | fgrep imwheel
to prove that imwheel is running.