Giter Site home page Giter Site logo

Comments (6)

GeorgRottensteiner avatar GeorgRottensteiner commented on June 6, 2024 1

Thanks, that helps a lot! I think using meta data with # would be the way to go forward. Have several labels in the followup line separated by comma, for example:

#META LABELS,ACTION_MENU
100 PRINT"What now?":INPUTA$

#META LABELS,OPEN_DOOR,REDRAW_SCREEN,ACTION_MENU
500 GOSUB 1000:GOSUB 8000:GOTO 100

would map to

ACTION_MENU
PRINT"What now?":INPUTA$
...

GOSUB OPEN_DOOR
GOSUB REDRAW_SCREEN
GOTO ACTION_MENU

from c64studio.

GeorgRottensteiner avatar GeorgRottensteiner commented on June 6, 2024

I'm not sure I understand correctly. You mean saving the label version as .bas file instead of the line number version?

from c64studio.

mwedmark avatar mwedmark commented on June 6, 2024

Sorry bad description. Saving with labels already seem possible. I'll rephrase it, make it possible to use any label name, just like in assembler. If there is a problem with parsing, maybe adding a ending char like colon could work.

from c64studio.

GeorgRottensteiner avatar GeorgRottensteiner commented on June 6, 2024

Can you please show an example where there's a problem currently, and how the resolved code should look like?
I think I understand, but that would make it a lot clearer for me.

from c64studio.

mwedmark avatar mwedmark commented on June 6, 2024

OK for example my current main file of the Chip8 emulator has 443 lines of code and will become much bigger if I include everything into it. It includes many GOSUB and GOTO statements of course. At one point I changed to LABEL mode but I actually went back. I didn't like the way the labels where named. It actually made keeping track of the code even harder than just a line numbers which is a pity. It would be really nice to be able to name my labels as the function they are suppose to execute.

An example (NOTE: Will be changed to ON GOTO later):
690 IFOX=0THENGOTO860:REM OXXX FAM
700 IFOX=16THENGOTO1010:REM 1XXX FAM
710 IFOX=32THENGOTO930:REM 2XXX FAM
720 IFOX=48THENGOTO1070:REM 3XXX FAM
730 IFOX=64THENGOTO1130:REM 4XXX FAM
740 IFOX=80THENGOTO1190:REM 5XXX FAM
750 IFOX=96THENGOTO1240:REM 6XXX FAM
760 IFOX=112THENGOTO1300:REM 7XXX FAM
770 IFOX=128THENGOTO1360:REM 8XXX FAM
780 IFOX=160THENGOTO1840:REM AXXX FAM
790 IFOX=176THENGOTO1890:REM BXXX FAM
800 IFOX=192THENGOTO2190:REM CXXX FAM
810 IFOX=208THENGOTO2250:REM DXXX FAM
820 IFOX=224THENGOTO2380:REM EXXX FAM
830 IFOX=240THENGOTO2570:REM FXXX FAM

This is the main construct of the opcode-interpreter. Now I use a comment to make it clearer where the GOTO lands.
It would be nicer and more readable if it could look like:
IFOX=0THENGOTO OXXX_FAM
IFOX=16THENGOTO 1XXX_FAM
IFOX=32THENGOTO 2XXX_FAM
IFOX=48THENGOTO 3XXX_FAM
IFOX=64THENGOTO 4XXX_FAM
IFOX=80THENGOTO 5XXX_FAM
IFOX=96THENGOTO 6XXX_FAM
IFOX=112THENGOTO 7XXX_FAM
IFOX=128THENGOTO 8XXX_FAM
IFOX=160THENGOTO AXXX_FAM
IFOX=176THENGOTO BXXX_FAM
IFOX=192THENGOTO CXXX_FAM
IFOX=208THENGOTO DXXX_FAM
IFOX=224THENGOTO EXXX_FAM
IFOX=240THENGOTO FXXX_FAM

And when switching between NUMBER and LABEL mode maybe the custom labels could be kept somewhere? Though this would of course be messed up if you started changing lots of stuff in NUMBER mode.. I don't have the exact solution there. If one would like to get advanced maybe a CRC32-checksum of row complete row content and keep that in a separate file for recreation when switching back and forth between NUMBER and LABEL mode. Rows that can't be found is recreated with those default labels.

from c64studio.

RhinoDevel avatar RhinoDevel commented on June 6, 2024

Would be really nice to have!

from c64studio.

Related Issues (20)

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.