Code Monkey home page Code Monkey logo

vm-76's People

Contributors

bobcao3 avatar satgo1546 avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

vm-76's Issues

声音模块的float → int之旅

当初干嘛用float呢?浪费一倍的内存,效果还不一定有int好。

虽然是这么说的,但是float现在哪里不好了?

  • play_wave
    • triangle
    • sine
    • white_noise
  • play_sound
    • play_sound
    • play_loop

添加了RenderBuffer之后又炸了

N卡和I卡都会炸。下面是I卡的调试记录。

Starting program: Y:\my\project76\VMGS\VMGS.exe
[New Thread 10480.0x2244]
[New Thread 10480.0x1c4c]
[New Thread 10480.0x5f4]
[New Thread 10480.0x22b4]
[12:33:16][VMGS][main] Hello! This is VM76. Nice to meet you!
[12:33:16][VMDE][init_engine] initializing the engine
[12:33:16][VMDE][init_engine] The system is little-endian.
[New Thread 10480.0x1fa4]
[New Thread 10480.0x164]
[Thread 10480.0x1fa4 exited with code 0]
[Thread 10480.0x164 exited with code 0]
[New Thread 10480.0x30a0]
[New Thread 10480.0x2860]
[New Thread 10480.0x209c]
[New Thread 10480.0x9dc]
[Thread 10480.0x2860 exited with code 0]
[Thread 10480.0x209c exited with code 0]
[Thread 10480.0x9dc exited with code 0]
[Thread 10480.0x30a0 exited with code 0]
[12:33:18][VMDE][glfw_error_callback] GLFW error 65543: WGL: Failed to create OpenGL context
[New Thread 10480.0x3544]
[New Thread 10480.0x1f68]
[New Thread 10480.0x2ccc]
[New Thread 10480.0x2b30]
[12:33:18][VMDE][init_graphics] OpenGL API: 3.3
[12:33:18][VMDE][init_graphics] UBO: GL33 Uniform Buffer Object
[12:33:18][VMDE][GL_info] ==========================
[12:33:18][VMDE][GL_info] OpenGL Info:
[12:33:18][VMDE][GL_info] Supproted GL Version 3.3
[12:33:18][VMDE][GL_info] ==========================
[12:33:18][VMDE][GL_info] Maximum vertex attributes: 16
[12:33:18][VMDE][GL_info] Maximum vertex output components: 128
[12:33:18][VMDE][GL_info] Maximum fragment shader storage blocks: 128
[12:33:18][VMDE][GL_info] Maximum texture size: 16384
[12:33:18][VMDE][GL_info] Maximum texture unit: 16
[12:33:18][VMDE][GL_info] ==========================
[New Thread 10480.0x11dc]
[New Thread 10480.0x2164]
[12:33:18][VMDE][init_engine] initialized the engine
[12:33:18][VMDE][Texture] Texture is loaded from ../Media/Font.bmp to texture unit
[12:33:18][VMDE][check_shader_compilation]
[12:33:18][VMDE][check_shader_compilation]
[12:33:18][VMDE][check_linkage]
[12:33:19][VMDE][Texture] Texture is loaded from ../Media/terrain.png to texture unit
[12:33:19][VMDE][Map] Init map with size 4, 4, 4 in chunk size 64
[12:33:19][VMDE][read_map] Reading map
[12:33:19][VMDE][generate_V1] Start generating maps, 256 x 256 x 256
[12:33:19][VMDE][generate_V1] Generated 0% (0 / 16777216)
[12:33:19][VMDE][generate_V1] Generated 8% (1376256 / 16777216)
[12:33:19][VMDE][generate_V1] Generated 16% (2752512 / 16777216)
[12:33:19][VMDE][generate_V1] Generated 24% (4128768 / 16777216)
[12:33:19][VMDE][generate_V1] Generated 32% (5505024 / 16777216)
[12:33:19][VMDE][generate_V1] Generated 41% (6881280 / 16777216)
[12:33:19][VMDE][generate_V1] Generated 49% (8257536 / 16777216)
[12:33:19][VMDE][generate_V1] Generated 57% (9633792 / 16777216)
[12:33:19][VMDE][generate_V1] Generated 65% (11010048 / 16777216)
[12:33:19][VMDE][generate_V1] Generated 73% (12386304 / 16777216)
[12:33:19][VMDE][generate_V1] Generated 82% (13762560 / 16777216)
[12:33:19][VMDE][generate_V1] Generated 90% (15138816 / 16777216)
[12:33:19][VMDE][generate_V1] Generated 98% (16515072 / 16777216)
[12:33:19][VMDE][generate_V1] Generated 100%, Complete
[12:33:19][VMDE][Map] Baking Chunks: 0% (0 / 64)
[12:33:20][VMDE][Map] Baking Chunks: 25% (16 / 64)
[12:33:20][VMDE][Map] Baking Chunks: 50% (32 / 64)
[12:33:20][VMDE][Map] Baking Chunks: 75% (48 / 64)
[12:33:21][VMDE][Map] Baking Chunks: 100%, map initialized
[12:33:21][VMDE][check_shader_compilation]
[12:33:21][VMDE][check_shader_compilation]
[12:33:21][VMDE][check_linkage]
[12:33:21][VMDE][check_shader_compilation]
[12:33:21][VMDE][check_shader_compilation]
[12:33:21][VMDE][check_linkage]
[12:33:21][VMDE][check_shader_compilation]
[12:33:21][VMDE][check_shader_compilation]
[12:33:21][VMDE][check_linkage]
[12:33:21][VMDE][check_shader_compilation]
[12:33:21][VMDE][check_shader_compilation]
[12:33:21][VMDE][check_linkage]
[12:33:21][VMDE][RenderBuffer] Creating Render Buffer of 860 x 540
[12:33:21][VMDE][Texture] Texture is loaded from ../Media/skybox.png to texture unit
[12:33:21][VMDE][check_shader_compilation]
[12:33:21][VMDE][check_shader_compilation]
[12:33:21][VMDE][check_linkage]

Thread 1 received signal SIGSEGV, Segmentation fault.
0x00000000 in ?? ()
(gdb) bt
#0  0x00000000 in ?? ()
#1  0x0041c5ba in RenderBuffer::bind (this=0xb78e318) at ../VMDE/global.hpp:338
#2  0x0041b21d in VM76::EditorMainScene::render (this=0x84e990) at Y:\my\project76\VMGS\Scene\EditorMainScene.cpp:180
#3  0x0041d716 in VM76::SceneManager::render_scene () at Y:\my\project76\VMGS\Scene\scene.cpp:27
#4  0x0040176e in VM76::loop () at Y:\my\project76\VMGS\main.cpp:30
#5  0x004018f5 in VM76::start_game () at Y:\my\project76\VMGS\main.cpp:48
#6  0x00401abc in main (argc=1, argv=0x841690) at Y:\my\project76\VMGS\main.cpp:68
(gdb)

近期我在自己的电脑上改动了一下库的路径,不过这应该没什么关系。

VMDE的公开讨论

待解决讨论之事,包括设计问题。随时可以补充。

  • 3D还是2D?
  • 纹理!纹理!纹理!名称叫Draw Engine,然而Draw的部分尚还不能画图片……
    • 用什么图片格式?这个问题其实没啥好问的,因为我们有天下无敌的PNG。
    • 导入其库。比如libpng。
    • 把load_img填完……
  • 音频
    • 采样率问题。关键是48000Hz怎么和44100Hz相互转换。这种问题应该许多人都问过。
    • 是否需要特别的音量控制?
  • 文字绘制
    • 如何画文字呢?位图字体还是FreeType?
    • 有需要用户自己输入的地方吗?

# @bobcao3 Cryst这种协作项目那边其实也可以开一个这样的issue玩

↑ 那个 # 被当成一级标题一直没被发现

Vulkan : Should we support it?

如你所见,我们目前的渲染结构还算干净,做Vulkan支持应该不算复杂。我们只需要更高一级的抽象。在基本渲染原理上,包括顶点缓冲啥的Vulkan和OpenGL没啥区别,最大的区别在于渲染drawcall的API上。我认为Vulkan的异步能力对我们是很有用的

讨论代码命名规范

比如enum TileList、namespace Audio、namespace VM76、#include "Tiles/tiles.hpp"……

如果嫌烦的话就叫一句“采用Ruby的”就好了,这样的话我就能把TileList光明正大地改成TileType了。

渲染模型新设计

发现现在这个模型太不灵活了,引擎没起引擎的大作用(

主要问题在于太多硬编码的东西,也不灵活

正在考虑的新的渲染模型:

  1. 加入渲染指令缓冲,废掉本来的立即操作

指令缓冲自生是一段编译完成的ASM76代码(或者说直接堆struct机器码),然后渲染调用指令用VM76尚未实现的BIOS功能来实现。参照Unity3D的渲染指令数量,这个不会是巨大工程

然后直接使用原来的XX::Draw的指令理论保持可用,但推荐把所有的渲染指令放进缓冲来降低以后
多线程支持的难度(现有的我尝试过多线程,lock复杂到想吃屎,然后根本没起多线程作用)

那么如何渲染呢?

  • 第一步,准备好指令缓冲并载入虚拟机
  • 第二步,跳转到合适的起点位置开始解析
  1. 渲染模型减少硬编码

让它尽量可配置化,其它的明天再补充xd

ASM76

在做寒假作业的间隙悄悄咪咪溜出来讨论一下ASM76。

  • 总体来说,因为我们这个汇编完全是为了好玩™,所以还是不要到处抄Intel为妙。
  • LCMM默认居然有16KB? 我建议改成0(滑稽),以增加LCMM指令的使用率。
    • 突然明白了这是坑。如果真是这样那就不改了。
  • 我们需要为它定一个目标。
    • 为了坑玩家?为了装逼?为了……?
    • 并在指令集中处处体现。

Windows上黑屏

刚修好一个崩溃的bug(3052e256def3bff7ba701214460052be74899524,还是用逐行打mark和log的方法搞定的,不得不说这mark太好使了),结果还是不能正常运行。

log是正常的。

Y:\project76>mingw32-make run
cd VMDE && mingw32-make -f build/msw.makefile
mingw32-make[1]: Entering directory 'Y:/project76/VMDE'
mingw32-make[1]: Nothing to be done for 'all'.
mingw32-make[1]: Leaving directory 'Y:/project76/VMDE'
cd VMGS && mingw32-make -f build/msw.makefile
mingw32-make[1]: Entering directory 'Y:/project76/VMGS'
mingw32-make[1]: Nothing to be done for 'all'.
mingw32-make[1]: Leaving directory 'Y:/project76/VMGS'
cd VMGS && VMGS.exe
[20:18:10][VMGS][main] Hello! This is VM76. Nice to meet you!
[20:18:10][VMDE][init_engine] initializing the engine
[20:18:11][VMDE][glfw_error_callback] GLFW error 65543: WGL: Failed to create OpenGL context
[20:18:11][VMDE][init_graphics] OpenGL API: 3.3
[20:18:11][VMDE][init_graphics] UBO: GL33 Uniform Buffer Object
[20:18:11][VMDE][GL_info] ==========================
[20:18:11][VMDE][GL_info] OpenGL Info:
[20:18:11][VMDE][GL_info] Supproted GL Version 3.3
[20:18:11][VMDE][GL_info] ==========================
[20:18:11][VMDE][GL_info] Maximum vertex attributes: 16
[20:18:11][VMDE][GL_info] Maximum vertex output components: 128
[20:18:11][VMDE][GL_info] Maximum fragment shader storage blocks: 128
[20:18:11][VMDE][GL_info] Maximum texture size: 16384
[20:18:11][VMDE][GL_info] Maximum texture unit: 16
[20:18:11][VMDE][GL_info] ==========================
[20:18:11][VMDE][init_engine] initialized the engine
[20:18:11][VMDE][Texture] Texture is loaded from ../Media/terrain.png to texture unit
[20:18:28][VMGS][terminate] starting to terminate
[20:18:28][VMDE][terminate_engine] engine terminated
[20:18:28][VMGS][terminate] terminated successfully

Y:\project76>

VM / 76 - FPS: 60

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.