0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

libmsx vscode Makefile tasks.json launch.json c_cpp_properties.json

Posted at
Makefile.
# -*- coding: utf-8-unix; tab-width: 8 -*-

# Copyright (c) 2021-2025 Daishi Mori (mori0091)
#
# This software is released under the MIT License.\n
# See https://github.com/mori0091/libmsx/blob/main/LICENSE
#
# GitHub libmsx project\n
# https://github.com/mori0091/libmsx

# ---------------------------------------------------------------
# This "Makefile" is a template to make application for MSX.
# Place a copy of this file under the top folder of your project,
# and customize the copied Makefile for your project.
# ---------------------------------------------------------------

# [REQUIRED]
# Path to top of the libmsx installed folder.
LIBMSX_HOME = /c/libmsx

# [REQUIRED]
# Specify NAME of your rom image to be built.
#   The rom image `${NAME}.rom` will be made into ${BINDIR} folder.
#   e.g. If NAME was foo, the image will be `bin/foo.rom`.
NAME = foo

# [OPTIONAL]
# You may specify additional C compiler/linker options.
#   - CFLAGS shall be C language options such as "-I dir"
#   - LDFLAGS shall be linker options such as "-L dir"
#   - LDLIBS shall be libraries to be linked such as "-lfoo" or "foo.lib"
#   - LIBS shall be your custom libraries to be linked such as "mylib.lib"
CFLAGS  = -DNDEBUG
LDFLAGS =
LDLIBS  =
LIBS    =

# [OPTIONAL]
# You may specify a folder where your C source code exists.
# (default is 'src', if omitted)
# SRCDIR = src

# [OPTIONAL]
# You may specify a folder where object code would to be made.
# (default is 'obj', if omitted)
# OBJDIR = obj

# [OPTIONAL]
# You may specify a folder where your rom image would to be made.
# (default is 'bin', if omitted)
# BINDIR = bin

# [OPTIONAL]
# You may specify a folder where your resource files exists.
# (default is 'resources', if omitted)
# The files in the ${RSCDIR} folder and its subfolders are concatenated at the
# end of the ROM image as NAMED RESOURCE and can be searched by name or read at
# run time.
# \note This feature is only available for MegaROM image. Thus `CONFIG_ROM_TYPE`
#       must be `ascii8` or `ascii16`, if you use resource files.
# \see bmem.h
# \see resources.h
# RSCDIR = resources

# [OPTIONAL]
# If `CONFIG_CRT0_MOD_INIT` is set to `init_x` or `init_r`, all connected system
# extensions (e.g. disk drive, RS-232C cartridge) are initialized and ready for
# use before your `main()` function starts. Maybe some RAM space and startup
# time are consumed though.
# (default is `init_0`, if omitted)
# \see https://github.com/mori0091/libmsx/blob/main/docs/design-notes_crt0.md
# CONFIG_CRT0_MOD_INIT = init_0

# [REQUIRED]
# Select ROM type.
# - 16k     : to make 16KiB rom image (0x4000-0x7fff)
# - 32k     : to make 32KiB rom image (0x4000-0xbfff)
# - ascii16 : to make MegaROM image (ROM type: ASCII16)
# - ascii8  : to make MegaROM image (ROM type: ASCII8)
# \see https://github.com/mori0091/libmsx/blob/main/docs/design-notes_crt0.md
CONFIG_ROM_TYPE = 32k

# [REQUIRED] (No need to modify)
# Include common part of Makefile
include ${LIBMSX_HOME}/mk/build.mk
tasks.json
{
    "version": "2.0.0",
    "tasks": [
        {
            "label": "Build MSX ROM (libmsx)",
            "type": "process",
            "command": "C:/msys64/usr/bin/bash.exe",
            "args": [
                "--login",
                "-c",
                "export CHERE_INVOKING=1; . /etc/profile; export MSYSTEM=UCRT64; export PATH=$PATH:/c/Program\\ Files/SDCC/bin; cd \"$(cygpath '${workspaceFolder}')\"; make NAME=${fileBasenameNoExtension}"
            ],
            "options": {
                "cwd": "${workspaceFolder}"
            },
            "group": {
                "kind": "build",
                "isDefault": true
            },
            "problemMatcher": {
                "base": "$gcc",
                "fileLocation": [
                    "relative",
                    "${workspaceFolder}"
                ]
            }
        }
    ]
}
launch.json
{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Run in openMSX",
            "type": "node",
            "request": "launch",
            // 実行したいプログラム(エミュレータ)のパス
            "runtimeExecutable": "実行したいプログラム(エミュレータ)のパス",
            "runtimeArgs": [
                "-cart",
                "${workspaceFolder}/bin/${fileBasenameNoExtension}.rom"
            ],
            "cwd": "${workspaceFolder}",
            "console": "internalConsole",
            // 起動前にビルドタスクを実行
            "preLaunchTask": "Build MSX ROM (libmsx)"
        }
    ]
}
c_cpp_properties.json
{
    "configurations": [
        {
            "name": "Win32",
            "includePath": [
                "C:/libmsx/include"
            ],
            "defines": [
                "_DEBUG",
                "UNICODE",
                "_UNICODE"
            ],
            "compilerPath": "C:/Program Files/SDCC/bin/sdcc.exe",
            "cStandard": "c89",
            "cppStandard": "gnu++98",
            "intelliSenseMode": "windows-gcc-x64"
        }
    ],
    "version": 4
}
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?