Skip to content

Commit

Permalink
Merge pull request #19 from mattgodbolt/mg/vite
Browse files Browse the repository at this point in the history
Port over to vite
  • Loading branch information
mattgodbolt authored Dec 19, 2024
2 parents 511e48c + fb01a90 commit 173e870
Show file tree
Hide file tree
Showing 44 changed files with 1,608 additions and 28,269 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ jobs:
python-version: '3.10'
- name: Unpack existing ROMs
run: |
cd public
curl -sL https://miracle.xania.org/miracle-roms.tar.gz | tar zx
- name: Build distribution
run: |
Expand All @@ -26,4 +27,4 @@ jobs:
AWS_S3_BUCKET: miracle.xania.org
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
SOURCE_DIR: "."
SOURCE_DIR: dist
31 changes: 28 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,28 @@
roms/
.*.swp
roms.js
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

# From original Miracle
public/roms/
src/roms.js
2 changes: 0 additions & 2 deletions .idea/.gitignore

This file was deleted.

8 changes: 0 additions & 8 deletions .idea/Miracle.iml

This file was deleted.

4 changes: 0 additions & 4 deletions .idea/encodings.xml

This file was deleted.

7 changes: 0 additions & 7 deletions .idea/jsLibraryMappings.xml

This file was deleted.

4 changes: 0 additions & 4 deletions .idea/misc.xml

This file was deleted.

8 changes: 0 additions & 8 deletions .idea/modules.xml

This file was deleted.

5 changes: 0 additions & 5 deletions .idea/scopes/scope_settings.xml

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/vcs.xml

This file was deleted.

4 changes: 0 additions & 4 deletions .jshintrc

This file was deleted.

11 changes: 0 additions & 11 deletions .project

This file was deleted.

19 changes: 10 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,20 @@
# Matthew Westcott, 14 Daisy Hill Drive, Adlington, Chorley, Lancs PR6 9NE UNITED KINGDOM

.PHONY: all z80 clean dist
all: z80 roms.js
all: z80 src/roms.js
dist: all
npm run build

ROMS := $(shell find roms -type f | sort)
ROMS := $(shell find public/roms -type f | sort)

roms.js: $(ROMS) Makefile
echo 'var RomList = [' > roms.js
for rom in $(ROMS); do echo \"$$rom\", | sed 's/roms\///g' >> roms.js; done
echo '];' >> roms.js
src/roms.js: $(ROMS) Makefile
echo 'export const RomList = [' > src/roms.js
for rom in $(ROMS); do echo \"$$rom\", | sed 's|public/roms/||g' >> src/roms.js; done
echo '];' >> src/roms.js

z80:
$(MAKE) -C z80
$(MAKE) -C src/z80

clean:
$(MAKE) -C z80 clean
rm -f roms.js
$(MAKE) -C src/z80 clean
rm -f src/roms.js
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
Miracle - a Javascript Sega Master System emulator
--------------------------------------------------

Requires `make`, `perl` and `python` to build. Place ROMs in the `roms` directory as
Requires `make`, `perl` and `python` to build. Place ROMs in the `public/roms` directory as
`romname.sms` and then run `make` to build the emulation script files and the ROM data.

To run locally run `npm run dev` and then go to http://localhost:5173.

z80 emulation and test are based on rev 1071 of http://svn.matt.west.co.tt/svn/jsspec/trunk

Miracle can be taken for a spin at https://miracle.xania.org/
15 changes: 2 additions & 13 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,8 @@
<html lang="en">
<head>
<title>Miracle - a JavaScript Sega Master System emulator</title>
<link rel="stylesheet" href="miracle.css" type="text/css">
<script type="text/javascript" src="lib/jquery-3.7.1.min.js"></script>
<script type="text/javascript" src="lib/jquery.editable-1.3.3.min.js"></script>
<script type="text/javascript" src="z80/z80_full.js"></script>
<script type="text/javascript" src="z80/z80_ops_full.js"></script>
<script type="text/javascript" src="z80/z80_dis.js"></script>
<script type="text/javascript" src="vdp.js"></script>
<script type="text/javascript" src="soundchip.js"></script>
<script type="text/javascript" src="miracle.js"></script>
<script type="text/javascript" src="debug.js"></script>
<script type="text/javascript" src="benchmark.js"></script>
<script type="text/javascript" src="roms.js"></script>
<script type="text/javascript" src="main.js"></script>
<link rel="stylesheet" href="/miracle.css" type="text/css">
<script type="module" src="/src/main.js"></script>
<script type="text/javascript">

var _gaq = _gaq || [];
Expand Down
2 changes: 0 additions & 2 deletions lib/jquery-3.7.1.min.js

This file was deleted.

10 changes: 0 additions & 10 deletions lib/jquery.editable-1.3.3.min.js

This file was deleted.

Loading

0 comments on commit 173e870

Please sign in to comment.