Comments (8)
When I started the project, parts of the code were a bit more complex and I think introducing macros back then made sense. Right now they're not necessary, but still used in places to avoid code duplication, especially to define opcodes:
op(0xA0, {
// mov
var data = safe_read8(read_moffs());
reg8[reg_al] = data;
});
Macros rarely improve speed. It's of a more convenience, for example the fact that you can pass a block of code to a macro. I have to admit that I went too far in at least one place, but I'll refactor that soon.
from v86.
The reason I asked this question is that I might try to refactor the code especially the macro part, also as a way to get familiar with the code, but I am not sure if you would like it.
from v86.
Feel free to ask before refactoring larger parts of the code. Right now I'm okay with the use of macros, but a second opinion on this could be interesting. too.
from v86.
Well, I'm not really involved at all in this project, but if I may say, I think that refactoring the macro portions of the code would be a good idea.
from v86.
I changed my mind, using macros wasn't a great idea. I'll look into refactoring the code to work without macros.
from v86.
Very glad to hear this. I wish I can help but I don't have much time lately. Also, it takes some time for a non-author like me to understand the code even to start any refactoring. But still, look forward for that to happen.
I have recently been thinking about writing complex programming projects with small modularized files (<200 lines each) that have no circular dependencies among files, so that it could be more easily understood by a new programmer/reader. But that might be just asking too much, and I am not sure if my methodology would really help a newcomer to understand the code after all. This is really another topic.
from v86.
Can we remove the C preprocessor dependency altogether including all macros associated with building the library? It's useless dependency now, all the code generated from macros can be used in source and later refactored if needed.
from v86.
Most macros should be refactored to functions, so that code isn't repeated too much. Doing that part later will be a pain. It shouldn't be too hard, I just haven't found the time to do it yet.
from v86.
Related Issues (20)
- hardcoded 'partfile_alt_format' HOT 2
- Windows 98 floppy disk support
- how did you build this HOT 1
- NodeJS performance on alpine/arch running on v86 HOT 27
- cirrus vga HOT 3
- Sound in ReactOS HOT 3
- Will There Be An Virtual x64 HOT 1
- what is Fetching v86.wasm ... HOT 13
- Bios or UFEI HOT 3
- Suggestion - Fast floats HOT 6
- Qcow2 file not working HOT 1
- Request: add ACPI support to the bios, or switch to one that supports it(whichever is easier) HOT 14
- Bugs in PS/2 implementation HOT 3
- Adding NX functionality via my fork, will request help there.
- QBasic can't access EGA or VGA modes in the DOS 6.22 image HOT 2
- Update Android-x86 Boot Time HOT 1
- Mechanism to communicate from emulated OS to API HOT 3
- issues HOT 4
- "Invalid argument" on creating file in 9p filesystem (Linux) HOT 13
- Windows 8 driver issue while using v86 HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from v86.