Skip to content

Commit

Permalink
Merge master into release/2
Browse files Browse the repository at this point in the history
--HG--
branch : release
  • Loading branch information
kazssym committed Jul 27, 2020
2 parents 35361bd + d01639e commit d2506f4
Show file tree
Hide file tree
Showing 38 changed files with 1,067 additions and 207 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# release.yml
# Copyright (C) 2020 Kaz Nishimura
#
# Copying and distribution of this file, with or without modification, are
# permitted in any medium without royalty provided the copyright notice and
# this notice are preserved. This file is offered as-is, without any warranty.
---
on:
push:
tags:
- release/*
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Version ${{ github.ref }}
body: |
This is ...
draft: true
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ config.h.in
configure
aclocal.m4
stamp-*
.dirstamp
Debug
Release
.libs
Expand Down
1 change: 1 addition & 0 deletions .hgignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ syntax: regexp
(^|/)configure$
(^|/)aclocal\.m4$
(^|/)stamp-[^/]*$
(^|/)\.dirstamp$
(^|/)Debug$
(^|/)Release$
(^|/)\.libs$
Expand Down
1 change: 1 addition & 0 deletions .hgtags
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
0b9aff908790e0dc941587209eb3a9ce1057004e release/2-alpha.1
bf7c62707dccb2d8bf7b84a625a3277920f137cd release/2-alpha.2
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@
"**/*.rej": true,
"**/*.orig": true,
"**/*~": true
}
},
"restructuredtext.confPath": "${workspaceFolder}/sphinx"
}
18 changes: 8 additions & 10 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
# this notice are preserved. This file is offered as-is, without any warranty.
---
variables:
package.distName: libvm68k-2-alpha.2
package.distName: libvm68k-2-alpha.3
uploadRepository: kazssym/libvm68k
trigger:
- master
- release/*
- feature/*
stages:
- stage: Default
jobs:
Expand Down Expand Up @@ -46,10 +46,10 @@ stages:
condition: succeededOrFailed()
- bash: |
make dist || exit $?
mkdir -p dist
mv -f '$(package.distName)'.* dist/
mkdir -p _dist
mv -f '$(package.distName)'.* _dist/
displayName: Make source archive
- publish: dist
- publish: _dist
artifact: dist
- stage: Test
jobs:
Expand All @@ -72,7 +72,7 @@ stages:
- download: current
artifact: dist
- bash: |
gzip -dc '$(Pipeline.Workspace)/dist/$(package.distName).tar.gz' | \
gzip -dc '$(Agent.BuildDirectory)/dist/$(package.distName).tar.gz' | \
tar -x
displayName: Unpack
- bash: |
Expand All @@ -91,7 +91,7 @@ stages:
workingDirectory: $(package.distName)
- stage: Release
dependsOn: Default
condition: >-
condition:
and(succeeded(),
startsWith(variables['Build.SourceBranch'], 'refs/heads/release/'))
jobs:
Expand All @@ -101,12 +101,10 @@ stages:
vmImage: ubuntu-latest
variables:
- group: bitbucket
- name: repository
value: kazssym/libvm68k
steps:
- download: current
artifact: dist
- bash: |
sh ./upload.sh -u '$(bitbucket.username):$(bitbucket.password)' \
-r '$(repository)' '$(Pipeline.Workspace)'/dist/*
-r '$(uploadRepository)' '$(Agent.BuildDirectory)'/dist/*
displayName: Upload
4 changes: 2 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.69])
AC_INIT([libvm68k], [2-alpha.2],
AC_INIT([libvm68k], [2-alpha.3],
[https://bitbucket.org/kazssym/libvm68k/issues/new],,
[https://www.vx68k.org/vx68k/libvm68k])
AC_CONFIG_SRCDIR([libvm68k/context.cpp])
AC_CONFIG_SRCDIR([libvm68k/execution_context.cpp])
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_MACRO_DIR([m4])
LT_PREREQ([2.4.6])
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ version: "2.4"
services:
builder:
build:
context: gcc
context: docker/gcc
image: kazssym/libvm68k-builder:gcc
network_mode: host
volumes:
Expand Down
3 changes: 3 additions & 0 deletions docker/gcc/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*.rej
*.orig
*~
File renamed without changes.
3 changes: 0 additions & 3 deletions gcc/.dockerignore

This file was deleted.

13 changes: 9 additions & 4 deletions libvm68k/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## Process this file with automake to produce Makefile.in.

AM_CPPFLAGS = -I$(top_srcdir)/config \
-I$(top_srcdir)/libvm68kapi -I$(top_builddir)/libvm68kapi
AM_CPPFLAGS = -D_LIBVM68K \
-I$(top_srcdir)/libvm68kapi

pkgconfigdir = $(libdir)/pkgconfig

Expand All @@ -12,11 +12,16 @@ EXTRA_DIST = vm68k.pc.in vm68k.cbproj ModelSupport_vm68k
pkgconfig_DATA = vm68k.pc

libvm68k_la_LDFLAGS = -version-info 1:0:0
libvm68k_la_SOURCES = context.cpp
libvm68k_la_SOURCES = \
runtime_register.cpp \
execution_context.cpp
EXTRA_libvm68k_la_SOURCES = win32dll.cpp

nobase_include_HEADERS = \
bits/vm68kcore.h bits/vm68k/register.h bits/vm68k/context.h
vm68k/runtime \
bits/vm68kcore.h \
bits/vm68k/internal/register.h \
bits/vm68k/internal/instruction.h
noinst_HEADERS = vm68kPCH1.h

CLEANFILES = $(pkgconfig_DATA)
Expand Down
73 changes: 73 additions & 0 deletions libvm68k/bits/vm68k/internal/instruction.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
// <bits/vm68k/internal/instruction.h>
// Copyright (C) 2012-2020 Kaz Nishimura
//
// This program is free software: you can redistribute it and/or modify it
// under the terms of the GNU General Public License as published by the Free
// Software Foundation, either version 3 of the License, or (at your option)
// any later version.
//
// This program is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
// more details.
//
// You should have received a copy of the GNU General Public License along with
// this program. If not, see <http://www.gnu.org/licenses/>.
//
// SPDX-License-Identifier: GPL-3.0-or-later

#ifndef _VM68K_INTERNAL_INSTRUCTION_H
#define _VM68K_INTERNAL_INSTRUCTION_H 1

#include <bits/vm68k/internal/register.h>
#include <vm68k/instruction>
#include <memory>
#include <utility>

namespace vm68k
{
/*
* Runtime execution contexts.
*/
class _VM68K_PUBLIC runtime_execution_context: public execution_context
{
private:
std::shared_ptr<memory_map> _memory;

private:
runtime_register_file _registers;

private:
long_word _pc;

public:
runtime_execution_context(const std::shared_ptr<memory_map> &memory,
long_word pc);

runtime_execution_context(std::shared_ptr<memory_map> &&memory,
long_word pc);

public:
virtual ~runtime_execution_context();

public:
auto memory() const -> std::shared_ptr<memory_map> final override
{
return _memory;
}

public:
register_file &registers() final override
{
return _registers;
}

public:
long_word pc() const override;

public:
void set_pc(long_word pc) override;
};
}

#endif
123 changes: 123 additions & 0 deletions libvm68k/bits/vm68k/internal/register.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
// <bits/vm68k/register.h>
// Copyright (C) 2020 Kaz Nishimura
//
// This program is free software: you can redistribute it and/or modify it
// under the terms of the GNU General Public License as published by the Free
// Software Foundation, either version 3 of the License, or (at your option)
// any later version.
//
// This program is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
// more details.
//
// You should have received a copy of the GNU General Public License along with
// this program. If not, see <http://www.gnu.org/licenses/>.
//
// SPDX-License-Identifier: GPL-3.0-or-later

#ifndef _VM68K_INTERNAL_REGISTER_H
#define _VM68K_INTERNAL_REGISTER_H 1

#include <vm68k/register>
#include <bits/vm68kcore.h>
#include <array>
#include <utility>
#include <cstdint>

namespace vm68k
{
/**
* Data registers.
*/
class _VM68K_PUBLIC data_register
{
private:
long_word _value;

public:
data_register &operator =(const long_word value)
{
_value = value;
return *this;
}

data_register &operator =(const word value)
{
auto preserved = _value.to_uint() & 0xffff0000U;
_value = long_word(preserved | value.to_uint());
return *this;
}

data_register &operator =(const byte value)
{
auto preserved = _value.to_uint() & 0xffffff00U;
_value = long_word(preserved | value.to_uint());
return *this;
}

public:
operator long_word() const noexcept
{
return _value;
}
};

/**
* Address registers.
*/
class _VM68K_PUBLIC address_register
{
private:
long_word _value;

public:
address_register &operator =(const long_word value)
{
_value = value;
return *this;
}

public:
operator long_word() const noexcept
{
return _value;
}
};

class _VM68K_PUBLIC runtime_register_file: public register_file
{
private:
// Array of the data registers.
std::array<data_register, D_REGISTER_MAX> _d;

// Array of the address registers.
std::array<address_register, A_REGISTER_MAX> _a;

public:
runtime_register_file();

runtime_register_file(const runtime_register_file &other);

runtime_register_file(runtime_register_file &&other);

public:
virtual ~runtime_register_file();

public:
long_word d(std::size_t regno) const override;

void set_d(std::size_t regno, long_word value) override;

void set_d(std::size_t regno, word value) override;

void set_d(std::size_t regno, byte) override;

public:
long_word a(std::size_t regno) const override;

void set_a(std::size_t regno, long_word value) override;
};
}

#endif
Loading

0 comments on commit d2506f4

Please sign in to comment.