├── obj
└── .dummy
├── plugins
└── .dummy
├── include
├── raygui.h
├── plugin.h
└── m68kconf-emu68k.h
├── resources
├── led.png
├── switch.png
├── lcd-grid.png
├── template.png
└── SpaceMono-Bold.ttf
├── target
├── asm
│ ├── blocks.xcf
│ ├── ascii4x8.png
│ ├── ascii8x8.png
│ ├── empty-testTemplate.asm
│ ├── machine1test1.asm
│ ├── asc2char.c
│ ├── flat12864test1.asm
│ ├── empty-sub-test.asm
│ └── flat12864dodge.asm
└── machines
│ ├── empty.xml
│ ├── flat12864.xml
│ └── machine1.xml
├── support
├── a68k
│ ├── History.txt
│ ├── Bugs.txt
│ ├── Makefile
│ ├── A68k.dsw
│ ├── Makefile-both
│ ├── A68k.dev
│ ├── readme.txt
│ ├── ToDo.txt
│ ├── A68k.dsp
│ ├── protos.h
│ ├── Opcodes.c
│ ├── A68kdef.h
│ └── A68kglb.h
└── srec
│ ├── libkk_srec.a
│ ├── Makefile.avr
│ ├── Makefile.arm
│ ├── LICENSE
│ ├── Makefile
│ ├── srec2bin.1
│ ├── bin2srec.1
│ ├── kk_srec.xcodeproj
│ └── xcshareddata
│ │ └── xcschemes
│ │ ├── kk_srec.xcscheme
│ │ ├── bin2srec.xcscheme
│ │ └── srec2bin.xcscheme
│ ├── README.md
│ ├── kk_srec.c
│ ├── kk_srec.h
│ ├── srec2bin.c
│ └── bin2srec.c
├── screenies
├── first-plugin.png
├── first-machine-xml.png
├── everythings-a-plugin.png
└── machine1-with-plugins.png
├── Screenshot_2025-10-21_15-15-34.png
├── .gitmodules
├── .gitignore
├── virtual-serial-cable.sh
├── MusashiPatch.txt
├── LICENSE
├── src
├── plugins
│ ├── libactivityView.c
│ ├── libVBL.c
│ ├── libkeyjoy.c
│ ├── libRunStepSkip.c
│ ├── libbreak.c
│ ├── libcodeView.c
│ ├── libsimpleOut.c
│ ├── libtemplate.c
│ ├── libsimpleIn.c
│ ├── libflat12864.c
│ ├── libmemView.c
│ └── libregView.c
└── plugin.c
├── Makefile
└── readme.md
/obj/.dummy:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/plugins/.dummy:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/include/raygui.h:
--------------------------------------------------------------------------------
1 | ../../raylib/examples/shapes/raygui.h
--------------------------------------------------------------------------------
/resources/led.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chriscamacho/emu68k/HEAD/resources/led.png
--------------------------------------------------------------------------------
/resources/switch.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chriscamacho/emu68k/HEAD/resources/switch.png
--------------------------------------------------------------------------------
/target/asm/blocks.xcf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chriscamacho/emu68k/HEAD/target/asm/blocks.xcf
--------------------------------------------------------------------------------
/resources/lcd-grid.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chriscamacho/emu68k/HEAD/resources/lcd-grid.png
--------------------------------------------------------------------------------
/resources/template.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chriscamacho/emu68k/HEAD/resources/template.png
--------------------------------------------------------------------------------
/support/a68k/History.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chriscamacho/emu68k/HEAD/support/a68k/History.txt
--------------------------------------------------------------------------------
/target/asm/ascii4x8.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chriscamacho/emu68k/HEAD/target/asm/ascii4x8.png
--------------------------------------------------------------------------------
/target/asm/ascii8x8.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chriscamacho/emu68k/HEAD/target/asm/ascii8x8.png
--------------------------------------------------------------------------------
/screenies/first-plugin.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chriscamacho/emu68k/HEAD/screenies/first-plugin.png
--------------------------------------------------------------------------------
/support/srec/libkk_srec.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chriscamacho/emu68k/HEAD/support/srec/libkk_srec.a
--------------------------------------------------------------------------------
/resources/SpaceMono-Bold.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chriscamacho/emu68k/HEAD/resources/SpaceMono-Bold.ttf
--------------------------------------------------------------------------------
/screenies/first-machine-xml.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chriscamacho/emu68k/HEAD/screenies/first-machine-xml.png
--------------------------------------------------------------------------------
/Screenshot_2025-10-21_15-15-34.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chriscamacho/emu68k/HEAD/Screenshot_2025-10-21_15-15-34.png
--------------------------------------------------------------------------------
/screenies/everythings-a-plugin.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chriscamacho/emu68k/HEAD/screenies/everythings-a-plugin.png
--------------------------------------------------------------------------------
/.gitmodules:
--------------------------------------------------------------------------------
1 | [submodule "support/Musashi"]
2 | path = support/Musashi
3 | url = https://github.com/kstenerud/Musashi.git
4 |
--------------------------------------------------------------------------------
/screenies/machine1-with-plugins.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chriscamacho/emu68k/HEAD/screenies/machine1-with-plugins.png
--------------------------------------------------------------------------------
/target/machines/empty.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/support/a68k/Bugs.txt:
--------------------------------------------------------------------------------
1 | A68k accepts some incorrect extensions like moveq.w, dbra.s or btst.w.
2 | I don't know whether I should fix this one because some sources seem to rely on this.
3 | Kevin Kofler
--------------------------------------------------------------------------------
/target/asm/empty-testTemplate.asm:
--------------------------------------------------------------------------------
1 | dc.l $00100000 * SP and PC
2 | dc.l $00000400
3 |
4 | rorg $400
5 |
6 | start:
7 |
8 | subi.b #1,d0
9 | move.b d0,($A0000) # output to latch
10 | move.b ($A0000),d0 # check it reads back.
11 |
12 | bra.s start # main loop
13 |
14 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | target/asm/*.bin
2 | target/asm/*.s
3 | target/asm/*.lst
4 | target/asm/asc2char
5 | emu68k
6 | obj/*.o
7 | plugins/*.so
8 | support/Musashi/*.o
9 | support/Musashi/m68kops.c
10 | support/Musashi/m68kops.h
11 | support/Musashi/m68kmake
12 | support/Musashi/softfloat/*.o
13 | support/a68k/*.o
14 | support/a68k/A68k
15 | support/srec/srec2bin
16 | support/srec/bin2srec
17 | support/srec/*.o
18 |
19 |
--------------------------------------------------------------------------------
/support/a68k/Makefile:
--------------------------------------------------------------------------------
1 | CC = gcc
2 |
3 | FORCEDCFLAGS = -funsigned-char -fno-exceptions -D__NOPROTO
4 | CFLAGS = -Os -s
5 |
6 | SRC := A68kmain.c Opcodes.c Operands.c Adirect.c A68kmisc.c Symtab.c Codegen.c
7 |
8 | OBJ = $(SRC:%.c=%.o)
9 |
10 | EXE = A68k
11 |
12 | all: $(EXE)
13 |
14 | .c.o:
15 | $(CC) $(FORCEDCFLAGS) $(CFLAGS) -c $< -o $@
16 |
17 | $(EXE):\
18 | $(OBJ)
19 | $(CC) $(CFLAGS) -o $@ $(OBJ)
20 |
21 | $(OBJ): A68kdef.h A68kglb.h protos.h
22 |
23 | clean:; rm -f $(OBJ) $(EXE) core
24 |
--------------------------------------------------------------------------------
/virtual-serial-cable.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | if [ "$EUID" -ne 0 ]
4 | then echo "You need Super COW!"
5 | exit
6 | fi
7 |
8 | socat pty,link=/dev/ttyEmu68Server pty,link=/dev/ttyEmu68Client &
9 |
10 | PID=$!
11 | sleep 1
12 | chgrp users /dev/ttyEmu68*
13 | chmod 664 /dev/ttyEmu68*
14 | echo
15 | echo "please connect your terminal to /dev/ttyEmu68Client"
16 | echo
17 | read -n 1 -s -r -p "Press any key to uplug virtual serial cable ($PID)"
18 | echo
19 |
20 | kill $PID
21 |
22 | echo "disconnected"
23 | echo
24 |
--------------------------------------------------------------------------------
/MusashiPatch.txt:
--------------------------------------------------------------------------------
1 | --- ../../Musashi/m68kcpu.h 2020-08-29 16:08:40.315118970 +0100
2 | +++ support/Musashi/m68kcpu.h 2020-09-05 21:05:20.229177084 +0100
3 | @@ -1482,11 +1482,13 @@
4 | static inline void m68ki_branch_8(uint offset)
5 | {
6 | REG_PC += MAKE_INT_8(offset);
7 | + m68ki_pc_changed(REG_PC);
8 | }
9 |
10 | static inline void m68ki_branch_16(uint offset)
11 | {
12 | REG_PC += MAKE_INT_16(offset);
13 | + m68ki_pc_changed(REG_PC);
14 | }
15 |
16 | static inline void m68ki_branch_32(uint offset)
17 |
--------------------------------------------------------------------------------
/support/a68k/A68k.dsw:
--------------------------------------------------------------------------------
1 | Microsoft Developer Studio Workspace File, Format Version 6.00
2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
3 |
4 | ###############################################################################
5 |
6 | Project: "A68k"=".\A68k.dsp" - Package Owner=<4>
7 |
8 | Package=<5>
9 | {{{
10 | }}}
11 |
12 | Package=<4>
13 | {{{
14 | }}}
15 |
16 | ###############################################################################
17 |
18 | Global:
19 |
20 | Package=<5>
21 | {{{
22 | }}}
23 |
24 | Package=<3>
25 | {{{
26 | }}}
27 |
28 | ###############################################################################
29 |
30 |
--------------------------------------------------------------------------------
/support/a68k/Makefile-both:
--------------------------------------------------------------------------------
1 | GCC = gcc
2 | GCC-DOS = /usr/i686-pc-msdosdjgpp/bin/gcc
3 | DJP-DOS = /usr/i686-pc-msdosdjgpp/bin/djp
4 |
5 | CFLAGS = -D__NOPROTO -O3 -s
6 |
7 | SRC := A68kmain.c Opcodes.c Operands.c Adirect.c A68kmisc.c Symtab.c Codegen.c
8 |
9 | OBJ = $(SRC:%.c=%.o)
10 | OBJ-DOS = $(SRC:%.c=%.obj)
11 |
12 | EXE = A68k
13 | EXE-DOS = A68k.exe
14 |
15 | all: $(EXE) $(EXE-DOS)
16 |
17 | .SUFFIXES: .obj
18 |
19 | .c.o:
20 | $(GCC) $(CFLAGS) -c $< -o $@
21 |
22 | .c.obj:
23 | $(GCC-DOS) $(CFLAGS) -c $< -o $@
24 |
25 | $(EXE):\
26 | $(OBJ)
27 | $(GCC) -s -o $@ $(OBJ)
28 |
29 | $(EXE-DOS):\
30 | $(OBJ-DOS)
31 | $(GCC-DOS) -s -o $@ $(OBJ-DOS)
32 | $(DJP-DOS) $@
33 |
34 | $(OBJ) $(OBJ-DOS): A68kdef.h A68kglb.h protos.h
35 |
36 | clean:; rm -f $(OBJ) $(OBJ-DOS) $(EXE) $(EXE-DOS) core
37 |
--------------------------------------------------------------------------------
/support/srec/Makefile.avr:
--------------------------------------------------------------------------------
1 | CC=avr-gcc
2 | CFLAGS=-Wall -std=c99 -pedantic -Wextra -Wno-unknown-pragmas -Os
3 | LDFLAGS=-Os
4 | AR=avr-ar
5 | ARFLAGS=rcs
6 |
7 | AVR_FLAGS=-DSREC_LINE_MAX_BYTE_COUNT=37
8 |
9 | OBJPATH = ./avr/
10 | OBJS = $(OBJPATH)kk_srec.o
11 | LIBPATH = ./avr/
12 | LIB = $(LIBPATH)libkk_srec.a
13 |
14 | .PHONY: all clean distclean test
15 |
16 | all: $(LIB)
17 |
18 | $(OBJS): kk_srec.h
19 | $(OBJS): | $(OBJPATH)
20 | $(LIB): | $(LIBPATH)
21 |
22 | $(LIB): $(OBJS)
23 | $(AR) $(ARFLAGS) $@ $+
24 |
25 | $(OBJPATH)%.o: %.c %.h
26 | $(CC) $(CFLAGS) $(AVR_FLAGS) -c $< -o $@
27 |
28 | $(sort $(LIBPATH) $(OBJPATH)):
29 | @mkdir -p $@
30 |
31 | clean:
32 | rm -f $(OBJS)
33 | @rmdir $(OBJPATH) >/dev/null 2>/dev/null || true
34 |
35 | distclean: | clean
36 | rm -f $(LIB)
37 | @rmdir $(LIBPATH) >/dev/null 2>/dev/null || true
38 |
39 |
--------------------------------------------------------------------------------
/target/asm/machine1test1.asm:
--------------------------------------------------------------------------------
1 | dc.l $00100000 * PC and SP
2 | dc.l $00000400
3 |
4 | rorg $400
5 |
6 | start:
7 |
8 | addi.b #1,d1
9 | subi.b #1,d0
10 |
11 | move d0,d2
12 | lsl.b #4,d2 # high nibble--
13 |
14 | move.b d1,d3
15 | andi.b #$0f,d3 # low nibble++
16 |
17 | or.b d2,d3 # d3 : high nibble++ low nibble--
18 |
19 | move.b d3,($A0000) # output to latch
20 |
21 | move.w #10000,d3 # delay loop for count (or too fast to see!)
22 | dly:
23 |
24 | move.b ($80002),d4 # input from switches W A2-A0
25 | btst.b #$07,d4
26 | beq.s noW
27 |
28 | andi.w #7,d4
29 | lsl.w #1,d4 # mask address and *2
30 | move.l #$B0000,a0
31 | move.b ($80000),d5
32 | move.b d5,0(a0,d4.w) # TODO syntax for (0,a0,d4) ???
33 |
34 | noW:
35 |
36 | dbra d3,dly
37 |
38 | bra.s start # main loop
39 |
40 |
--------------------------------------------------------------------------------
/support/srec/Makefile.arm:
--------------------------------------------------------------------------------
1 | CROSS=arm-none-eabi-
2 | CC=$(CROSS)gcc
3 | CFLAGS=-Wall -std=c99 -pedantic -Wextra -Wno-unknown-pragmas -Os -mlittle-endian -mthumb -fsingle-precision-constant -ffunction-sections -fdata-sections
4 | LDFLAGS=-Wl,--gc-sections
5 | AR=$(CROSS)ar
6 | ARFLAGS=rcs
7 |
8 | ARM_FLAGS=-DSREC_LINE_MAX_BYTE_COUNT=37
9 |
10 | OBJPATH = ./arm/
11 | OBJS = $(OBJPATH)kk_srec.o
12 | LIBPATH = ./arm/
13 | LIB = $(LIBPATH)libkk_srec.a
14 |
15 | .PHONY: all clean distclean test
16 |
17 | all: $(LIB)
18 |
19 | $(OBJS): kk_srec.h
20 | $(OBJS): | $(OBJPATH)
21 | $(LIB): | $(LIBPATH)
22 |
23 | $(LIB): $(OBJS)
24 | $(AR) $(ARFLAGS) $@ $+
25 |
26 | $(OBJPATH)%.o: %.c %.h
27 | $(CC) $(CFLAGS) $(ARM_FLAGS) -c $< -o $@
28 |
29 | $(sort $(LIBPATH) $(OBJPATH)):
30 | @mkdir -p $@
31 |
32 | clean:
33 | rm -f $(OBJS)
34 | @rmdir $(OBJPATH) >/dev/null 2>/dev/null || true
35 |
36 | distclean: | clean
37 | rm -f $(LIB)
38 | @rmdir $(LIBPATH) >/dev/null 2>/dev/null || true
39 |
40 |
--------------------------------------------------------------------------------
/target/machines/flat12864.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2020 chriscamacho
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/support/srec/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2015 Kimmo Kulovesi
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy of
6 | this software and associated documentation files (the "Software"), to deal in
7 | the Software without restriction, including without limitation the rights to
8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9 | the Software, and to permit persons to whom the Software is furnished to do so,
10 | subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21 |
--------------------------------------------------------------------------------
/support/a68k/A68k.dev:
--------------------------------------------------------------------------------
1 | #This is the A68k project file for Dev-C++, an IDE for Mingw32.
2 |
3 | [Project]
4 | FileName=E:\TI-89\a68k\A68k.dev
5 | Name=A68k
6 | Use_gpp=0
7 | UnitCount=10
8 | ResFiles=
9 | NoConsole=0
10 | IsDll=0
11 | Icon=E:\DEVCPP\BIN\Mainicon.ico
12 | CompilerOptions=-funsigned-char -D__NOPROTO -O3
13 | IncludeDirs=
14 | ObjFile=
15 |
16 | [Unit1]
17 | FileName=E:\TI-89\a68k\protos.h
18 | FileTime=721199979
19 |
20 | [Unit2]
21 | FileName=E:\TI-89\a68k\A68kglb.h
22 | FileTime=843030652
23 |
24 | [Unit3]
25 | FileName=E:\TI-89\a68k\A68kmain.c
26 | FileTime=855597356
27 |
28 | [Unit4]
29 | FileName=E:\TI-89\a68k\A68kmisc.c
30 | FileTime=787443210
31 |
32 | [Unit5]
33 | FileName=E:\TI-89\a68k\Adirect.c
34 | FileTime=843028778
35 |
36 | [Unit6]
37 | FileName=E:\TI-89\a68k\Codegen.c
38 | FileTime=843030946
39 |
40 | [Unit7]
41 | FileName=E:\TI-89\a68k\Opcodes.c
42 | FileTime=720572548
43 |
44 | [Unit8]
45 | FileName=E:\TI-89\a68k\Operands.c
46 | FileTime=843030805
47 |
48 | [Unit9]
49 | FileName=E:\TI-89\a68k\A68kdef.h
50 | FileTime=843028905
51 |
52 | [Unit10]
53 | FileName=E:\TI-89\a68k\Symtab.c
54 | FileTime=855597486
55 |
56 |
--------------------------------------------------------------------------------
/support/srec/Makefile:
--------------------------------------------------------------------------------
1 | CC=clang
2 | CFLAGS=-Wall -std=c99 -pedantic -Wextra -Weverything -Wno-padded -Os #-emit-llvm
3 | LDFLAGS=-Os
4 | AR=ar
5 | ARFLAGS=rcs
6 |
7 | OBJS = kk_srec.o bin2srec.o srec2bin.o
8 | BINPATH = ./
9 | LIBPATH = ./
10 | BINS = $(BINPATH)srec2bin $(BINPATH)bin2srec
11 | LIB = $(LIBPATH)libkk_srec.a
12 | TESTER =
13 | TESTFILE = $(LIB)
14 |
15 | .PHONY: all clean distclean test
16 |
17 | all: $(BINS) $(LIB)
18 |
19 | $(OBJS): kk_srec.h
20 | $(BINS): | $(BINPATH)
21 | $(LIB): | $(LIBPATH)
22 |
23 | $(LIB): $(OBJS)
24 | $(AR) $(ARFLAGS) $@ $+
25 |
26 | $(BINPATH)srec2bin: srec2bin.o $(LIB)
27 | $(CC) $(LDFLAGS) -o $@ $+
28 |
29 | $(BINPATH)bin2srec: bin2srec.o $(LIB)
30 | $(CC) $(LDFLAGS) -o $@ $+
31 |
32 | test: $(BINPATH)bin2srec $(BINPATH)srec2bin $(TESTFILE)
33 | @$(TESTER) $(BINPATH)bin2srec -v -a 0x80000 \
34 | -h '123456789_123456789_123456789_1' \
35 | -i '$(TESTFILE)' -x 0xFF | \
36 | $(TESTER) $(BINPATH)srec2bin -A -v | \
37 | diff '$(TESTFILE)' -
38 | @echo Loopback test success!
39 |
40 | $(sort $(BINPATH) $(LIBPATH)):
41 | @mkdir -p $@
42 |
43 | clean:
44 | rm -f $(OBJS)
45 |
46 | distclean: | clean
47 | rm -f $(BINS) $(LIB)
48 | @rmdir $(BINPATH) $(LIBPATH) >/dev/null 2>/dev/null || true
49 |
50 |
--------------------------------------------------------------------------------
/support/a68k/readme.txt:
--------------------------------------------------------------------------------
1 | A68k sources:
2 | =============
3 |
4 | This directory contains:
5 |
6 | FILE | CONTENTS
7 | --------------+-----------------------------------------------------------------
8 | Doc.txt | The A68k documentation
9 | --------------+-----------------------------------------------------------------
10 | History.txt | The A68k history
11 | --------------+-----------------------------------------------------------------
12 | Bugs.txt | The list of known bugs
13 | --------------+-----------------------------------------------------------------
14 | ToDo.txt | List of things which should or could be done in future versions
15 | --------------+-----------------------------------------------------------------
16 | Makefile | Makefile for GCC (GCC for GNU/Linux, DJGPP, Mingw32, Cygwin)
17 | --------------+-----------------------------------------------------------------
18 | Makefile-both | Makefile for GCC for GNU/Linux to create both the GNU/Linux and
19 | | the DJGPP version. (OLD! Probably still works though.)
20 | --------------+-----------------------------------------------------------------
21 | A68k.dev | Project file for Dev-C++, an IDE for Mingw32
22 | --------------+-----------------------------------------------------------------
23 | A68k.dsp | Project files for Microsoft Visual C++
24 | A68k.dsw | (contributed by Paul Froissart)
25 | --------------+-----------------------------------------------------------------
26 | A68kdef.h |
27 | A68kglb.h | Header files (for all supported compilers)
28 | protos.h |
29 | --------------+-----------------------------------------------------------------
30 | A68kmain.c |
31 | A68kmisc.c |
32 | Adirect.c |
33 | Codegen.c | C Source files (for all supported compilers)
34 | Opcodes.c |
35 | Operands.c |
36 | Symtab.c |
--------------------------------------------------------------------------------
/src/plugins/libactivityView.c:
--------------------------------------------------------------------------------
1 |
2 | #include "plugin.h"
3 | #include
4 | #include
5 | #include "raylib.h"
6 | #include "raygui.h"
7 | #include
8 |
9 | /*
10 | * activityView plugin
11 | *
12 | * shows the emulation log
13 | *
14 | */
15 |
16 | typedef struct {
17 |
18 | char** log;
19 |
20 | } activityViewVars;
21 |
22 |
23 | // set up
24 | G_MODULE_EXPORT void initialise(void* inst)
25 | {
26 | plugInstStruct* pl = (plugInstStruct*)inst;
27 | pl->data = malloc(sizeof(activityViewVars));
28 |
29 | pl->size = (Vector2){512,360}; // size is always the same for all instances
30 | pl->outTx = LoadRenderTexture(pl->size.x, pl->size.y); // plugin should only draw on this
31 |
32 | SetTextureFilter(pl->outTx.texture, TEXTURE_FILTER_BILINEAR);
33 |
34 | // clear out / initialize anything in vars like strings etc
35 |
36 | }
37 |
38 |
39 | G_MODULE_EXPORT void setProperty(void* inst, char* prop, void* value)
40 | {
41 | plugInstStruct* pl = (plugInstStruct*)inst;
42 | activityViewVars* vars = ((activityViewVars*)pl->data);
43 |
44 | if (g_ascii_strcasecmp(prop,"log")==0) vars->log = value;
45 |
46 | }
47 |
48 | // This function can access the UI
49 | G_MODULE_EXPORT void draw(void* inst)
50 | {
51 | // rendering takes place on plugin instances render texture.
52 | plugInstStruct* pl = (plugInstStruct*)inst;
53 | activityViewVars* vars = ((activityViewVars*)pl->data);
54 |
55 | BeginTextureMode(pl->outTx);
56 | ClearBackground((Color){48,96,48,128});
57 | for(int i=0; i<16; i++) {
58 | GuiLabel((Rectangle){ 2, 4+i*20, 512, 22}, vars->log[i]);
59 | }
60 | EndTextureMode();
61 | }
62 |
63 |
64 | // The following functions cannot access the UI
65 | G_MODULE_EXPORT void clicked(void* inst, int x, int y) { }
66 |
67 | // TODO put in plugInstStruct set in initialise
68 | G_MODULE_EXPORT int getAddressSize() { return 0; } // signals not memory mapped
69 |
70 | G_MODULE_EXPORT byte getAddress(void* inst, int address) { return 0xff; }
71 |
72 | G_MODULE_EXPORT void setAddress(void* inst, int address, byte data) { }
73 |
--------------------------------------------------------------------------------
/src/plugins/libVBL.c:
--------------------------------------------------------------------------------
1 |
2 | #include "plugin.h"
3 | #include
4 | #include
5 | #include "raylib.h"
6 |
7 | // keeps track of the frame, if the value changes its a new frame
8 | // allows the sim to sync up with the UI
9 | // think of it like waiting for the vertical blank...
10 |
11 |
12 |
13 | typedef struct {
14 | byte val;
15 | char bitNames[8][16];
16 | } VBLvars;
17 |
18 |
19 |
20 | G_MODULE_EXPORT void initialise(void* inst)
21 | {
22 |
23 | plugInstStruct* pl = (plugInstStruct*)inst;
24 | pl->data = malloc(sizeof(VBLvars));
25 | VBLvars* vars = ((VBLvars*)pl->data);
26 | pl->size = (Vector2){64,64};
27 | pl->outTx = LoadRenderTexture(pl->size.x, pl->size.y);
28 | SetTextureFilter(pl->outTx.texture, TEXTURE_FILTER_BILINEAR);
29 | if (pl->plug->resTx.id==0) pl->plug->resTx = LoadTexture("resources/template.png");
30 | SetTextureFilter(pl->plug->resTx, TEXTURE_FILTER_BILINEAR); // Texture scale filter to use
31 |
32 | vars->val = 0x00;
33 | }
34 |
35 | G_MODULE_EXPORT void setProperty(void* inst, char* prop, void* value)
36 | {
37 |
38 | }
39 |
40 | // This function can access the UI
41 | G_MODULE_EXPORT void draw(void* inst)
42 | {
43 | // rendering takes place on plugin instances render texture.
44 | plugInstStruct* pl = (plugInstStruct*)inst;
45 | VBLvars* vars = ((VBLvars*)pl->data);
46 | vars->val++;
47 | BeginTextureMode(pl->outTx);
48 | ClearBackground(BLANK);
49 | DrawTexture(pl->plug->resTx, 0,0, WHITE);
50 | DrawText(TextFormat("%02X",vars->val), 28, 48, 20, BLACK);
51 | EndTextureMode();
52 | }
53 |
54 |
55 | // The following functions cannot access the UI
56 | G_MODULE_EXPORT void clicked(void* inst, int x, int y) { }
57 |
58 | // TODO put in plugInstStruct set in initialise
59 | G_MODULE_EXPORT int getAddressSize() { return 1; }
60 |
61 | // is is only called with a valid address for the device so
62 | // we don't need to check it (only 1 byte)
63 | G_MODULE_EXPORT byte getAddress(void* inst, int address)
64 | {
65 | plugInstStruct* pl = (plugInstStruct*)inst;
66 | VBLvars* vars = ((VBLvars*)pl->data);
67 | return vars->val;
68 | }
69 | G_MODULE_EXPORT void setAddress(void* inst, int address, byte data) { }
70 |
--------------------------------------------------------------------------------
/support/srec/srec2bin.1:
--------------------------------------------------------------------------------
1 | .Dd March 5, 2015
2 | .Dt srec2bin 1
3 | .Os kk_srec
4 | .Sh NAME
5 | .Nm srec2bin
6 | .Nd Convert Motorola SREC encoded data to binary
7 | .Sh SYNOPSIS
8 | .Nm
9 | .Op Fl a Ar address_offset | Fl A
10 | .Op Fl i Ar input_file.srec
11 | .Op Fl o Ar output_file.bin
12 | .Op Fl v
13 | .Sh DESCRIPTION
14 | .Nm
15 | reads Motorola SREC encoded data from standard input and writes the
16 | decoded binary data to standard output.
17 | .Sh OPTIONS
18 | .Bl -tag -width -indent
19 | .It Fl a Ar address_offset
20 | Set the address of the first byte output to
21 | .Ar address_offset
22 | - by default the output respects the addres read from the input, but
23 | with many SREC files produced by compilers the data have an offset
24 | (possibly mega- or gigabytes), which may cause the output file to be
25 | unnecessarily large. The offset specified by this parameter is
26 | subtracted from all addresses read from the file.
27 | .It Fl A
28 | Autodetect the address offset (see
29 | .Ar -a
30 | above), i.e., the first output byte written will have the address of the
31 | first byte of input - this option should almost always be used!
32 | .It Fl i Ar file
33 | Read the Motorola SREC input from
34 | .Ar file
35 | instead of standard input
36 | .It Fl o Ar file
37 | Write the binary output to
38 | .Ar file
39 | instead of standard output
40 | .It Fl v
41 | Print extra status messages to standard error
42 | .El
43 | .Sh EXAMPLES
44 | Read Motorola SREC from
45 | .Ar input.srec
46 | and write the binary output to
47 | .Ar output.bin
48 | such that the first byte of input is written as the first byte
49 | of output (even if the input specifies an address offset):
50 | .Pp
51 | .Bd -ragged -offset indent
52 | .Nm
53 | .Fl A
54 | .Fl i
55 | .Ar input.srec
56 | .Fl o
57 | .Ar output.bin
58 | .Ed
59 | .Pp
60 | Read Motorola SREC from
61 | .Ar input.srec
62 | and write the binary output to
63 | .Ar output.bin
64 | such that the offset
65 | .Ar 0x8000000
66 | is subtracted from input addresses:
67 | .Bd -ragged -offset indent
68 | .Nm
69 | .Fl a
70 | .Ar 0x8000000
71 | .Fl i
72 | .Ar input.srec
73 | .Fl o
74 | .Ar output.bin
75 | .Ed
76 | .Sh AUTHOR
77 | .An "Kimmo Kulovesi" Aq http://arkku.com
78 |
--------------------------------------------------------------------------------
/target/asm/asc2char.c:
--------------------------------------------------------------------------------
1 | #include "../../raylib/src/raylib.h"
2 | #include
3 |
4 | // gcc asc2char.c ../../raylib/src/libraylib.a -o asc2char -lm -lX11 -ldl -pthread
5 |
6 | void main() {
7 | SetTraceLogLevel(LOG_ERROR);
8 | Image img = LoadImage("ascii4x8.png");
9 | ImageFormat(&img, UNCOMPRESSED_GRAYSCALE);
10 | Image img2 = LoadImage("ascii8x8.png");
11 | ImageFormat(&img2, UNCOMPRESSED_GRAYSCALE);
12 |
13 | unsigned char* p;
14 | int a=32;
15 |
16 | printf("\n");
17 | printf("font4x8:\n");
18 |
19 | for (int y=0; y<6; y++) {
20 | for (int x=0; x<16; x++) {
21 |
22 | int xx = x * 4;
23 | int yy = y * 64 * 8;
24 | p = ((unsigned char*)img.data) + xx + yy;
25 | for (int i=0; i<8; i++) {
26 | printf(" dc.b %%0000");
27 | if (p[0]==0x00) { printf("0"); } else { printf("1"); }
28 | if (p[1]==0x00) { printf("0"); } else { printf("1"); }
29 | if (p[2]==0x00) { printf("0"); } else { printf("1"); }
30 | if (p[3]==0x00) { printf("0"); } else { printf("1"); }
31 | if (i==0 && a<127) printf(" ; '%c' %i",a,a);
32 | if (i==0 && a>126) printf(" ; '?' %i",a,a);
33 | printf("\n");
34 | p=p+64;
35 | }
36 | printf("\n");
37 | a++;
38 | }
39 |
40 | }
41 | printf("\n");
42 | printf("\n");
43 | printf("\nfont8x8:\n");
44 |
45 | a = 32;
46 | for (int y=0; y<6; y++) {
47 | for (int x=0; x<16; x++) {
48 |
49 | int xx = x * 8;
50 | int yy = y * 128 * 8;
51 | p = ((unsigned char*)img2.data) + xx + yy;
52 | for (int i=0; i<8; i++) {
53 | printf(" dc.b %%");
54 | if (p[0]==0x00) { printf("0"); } else { printf("1"); }
55 | if (p[1]==0x00) { printf("0"); } else { printf("1"); }
56 | if (p[2]==0x00) { printf("0"); } else { printf("1"); }
57 | if (p[3]==0x00) { printf("0"); } else { printf("1"); }
58 | if (p[4]==0x00) { printf("0"); } else { printf("1"); }
59 | if (p[5]==0x00) { printf("0"); } else { printf("1"); }
60 | if (p[6]==0x00) { printf("0"); } else { printf("1"); }
61 | if (p[7]==0x00) { printf("0"); } else { printf("1"); }
62 | if (i==0 && a<127) printf(" ; '%c' %i",a,a);
63 | if (i==0 && a>126) printf(" ; '?' %i",a,a);
64 | printf("\n");
65 | p=p+128;
66 | }
67 | printf("\n");
68 | a++;
69 | }
70 |
71 | }
72 | printf("\n");
73 | }
74 |
--------------------------------------------------------------------------------
/include/plugin.h:
--------------------------------------------------------------------------------
1 | #include
2 | #include "raylib.h"
3 | #include "../support/Musashi/m68k.h"
4 |
5 | typedef unsigned char byte;
6 |
7 |
8 | // plugin emu api - not much for now...
9 | void setBreakPoint(unsigned int bp);
10 | void setRunning(bool run);
11 | void doStep();
12 | void doSkip();
13 | bool isRunning();
14 | // TODO should be getEmuProperty too, for better isolation of plugins
15 |
16 |
17 |
18 |
19 | // TODO this was introduced before rayGui was in use
20 | // should probably replace this with plugins that
21 | // use the gui instead... (see libsimpleIn compared to others)
22 | typedef void (* clickedFunc) (void* pInst, int x, int y);
23 |
24 |
25 |
26 | typedef void (* initialiseFunc) (void* pInst);
27 | typedef int (* getAddressSizeFunc) ();
28 | typedef byte (* getAddressFunc) (void* pInst, int address);
29 | typedef void (* setAddressFunc) (void* pInst, int address, byte data);
30 | typedef void (* updateAndDrawFunc) (void* pInst);
31 | typedef void (* setPropertyFunc) (void* inst, const char* prop, void* value);
32 |
33 |
34 |
35 | typedef struct {
36 | GModule *module;
37 | char libName[1024];
38 | Texture resTx; // shared single texture resource - all plugins of same type have this same texture
39 | Font font;
40 |
41 | initialiseFunc initialise;
42 | getAddressSizeFunc getAddressSize;
43 | getAddressFunc getAddress;
44 | setAddressFunc setAddress;
45 | clickedFunc clicked;
46 | updateAndDrawFunc draw;
47 |
48 | setPropertyFunc setProperty;
49 |
50 | } pluginStruct;
51 |
52 |
53 | typedef struct {
54 | pluginStruct* plug; // type of plugin
55 | char name[80];
56 | int addressStart; // the first address in the block of memory mapped to the plugin
57 | RenderTexture2D outTx; // each instance has its own render texture for output
58 |
59 | Vector2 pos;
60 | Vector2 size;
61 |
62 | byte* memPtr; // pointer to ram some UI plugins need to spy on memory, "device" plugins shouldn't!
63 | unsigned int RamSize;
64 |
65 |
66 | void* data; // custom data for the plugin
67 |
68 | } plugInstStruct;
69 |
70 |
71 |
72 |
73 | void integratePlugin(pluginStruct *plugin);
74 | void namePluginInstance(plugInstStruct *plugInst, char* str);
75 | void setPluginInstanceStartAddress(plugInstStruct *plugInst, int a);
76 | void make_hex(char* buff, byte* mem, unsigned int pc, unsigned int max, unsigned int length);
77 |
--------------------------------------------------------------------------------
/support/srec/bin2srec.1:
--------------------------------------------------------------------------------
1 | .Dd March 6, 2015
2 | .Dt bin2srec 1
3 | .Os kk_srec
4 | .Sh NAME
5 | .Nm bin2srec
6 | .Nd Convert binary data to Motorola SREC
7 | .Sh SYNOPSIS
8 | .Nm
9 | .Op Fl a Ar address_offset
10 | .Op Fl b Ar address_bytes
11 | .Op Fl h Ar header_text
12 | .Op Fl i Ar input_file.bin
13 | .Op Fl o Ar output_file.srec
14 | .Op Fl x Ar execution_start
15 | .Op Fl v
16 | .Sh DESCRIPTION
17 | .Nm
18 | reads binary data from standard input, and writes Motorola SREC
19 | encoded ASCII to standard output.
20 | .Sh OPTIONS
21 | .Bl -tag -width -indent
22 | .It Fl a Ar address_offset
23 | Set the address of the first input byte to
24 | .Ar address_offset
25 | - by default zero is used (i.e., SREC addresses correspond to
26 | positions in the input file).
27 | .It Fl b Ar address_bytes
28 | Set the number of address bytes (2 = 16-bit, 3 = 24-bit, 4 = 32-bit) to
29 | .Ar address_bytes
30 | - by default the least amount required for the input file is used,
31 | or 4 if the input is a stream.
32 | .It Fl h Ar header_text
33 | Set the header ASCII comment text to
34 | .Ar header_text
35 | - by default the input file name is used.
36 | .It Fl i Ar file
37 | Read the binary input from
38 | .Ar file
39 | instead of standard input.
40 | .It Fl o Ar file
41 | Write the SREC output to
42 | .Ar file
43 | instead of standard output.
44 | .It Fl x Ar execution_start
45 | Set the execution start address to
46 | .Ar execution_start
47 | - by default zero is written (as it is often ignored).
48 | .It Fl v
49 | Print extra status messages to standard error.
50 | .El
51 | .Sh EXAMPLES
52 | Read binary data from
53 | .Ar input.bin
54 | and write the Motorola S-Record output to
55 | .Ar output.srec
56 | with autodetected address byte count:
57 | .Pp
58 | .Bd -ragged -offset indent
59 | .Nm
60 | .Fl i
61 | .Ar input.bin
62 | .Fl o
63 | .Ar output.srec
64 | .Ed
65 | .Pp
66 | Read binary data from
67 | .Ar input.bin
68 | and write the SREC output to
69 | .Ar output.srec
70 | such that the offset
71 | .Ar 0x80000
72 | is added to addresses, which are written in
73 | .Ar 4
74 | bytes (32-bits), and write
75 | .Ar 0xA0000
76 | as the execution start address:
77 | .Bd -ragged -offset indent
78 | .Nm
79 | .Fl a
80 | .Ar 0x80000
81 | .Fl b
82 | .Ar 4
83 | .Fl i
84 | .Ar input.bin
85 | .Fl o
86 | .Ar output.srec
87 | .Fl x
88 | .Ar 0xA0000
89 | .Ed
90 | .Sh AUTHOR
91 | .An "Kimmo Kulovesi" Aq http://arkku.com
92 |
--------------------------------------------------------------------------------
/src/plugins/libkeyjoy.c:
--------------------------------------------------------------------------------
1 |
2 | #include "plugin.h"
3 | #include
4 | #include
5 | #include "raylib.h"
6 |
7 | // TODO allow changing of keycodes via setProperty
8 |
9 | typedef struct {
10 | byte val;
11 | } keyJoyVars;
12 |
13 |
14 |
15 | G_MODULE_EXPORT void initialise(void* inst)
16 | {
17 |
18 | plugInstStruct* pl = (plugInstStruct*)inst;
19 | pl->data = malloc(sizeof(keyJoyVars));
20 | keyJoyVars* vars = ((keyJoyVars*)pl->data);
21 | pl->size = (Vector2){64,64};
22 | pl->outTx = LoadRenderTexture(pl->size.x, pl->size.y);
23 | SetTextureFilter(pl->outTx.texture, TEXTURE_FILTER_BILINEAR);
24 | if (pl->plug->resTx.id==0) pl->plug->resTx = LoadTexture("resources/template.png");
25 | SetTextureFilter(pl->plug->resTx, TEXTURE_FILTER_BILINEAR); // Texture scale filter to use
26 |
27 | vars->val = 0x00;
28 |
29 | }
30 |
31 | G_MODULE_EXPORT void setProperty(void* inst, char* prop, void* value) { }
32 |
33 | // This function can access the UI
34 | G_MODULE_EXPORT void draw(void* inst)
35 | {
36 | // rendering takes place on plugin instances render texture.
37 | plugInstStruct* pl = (plugInstStruct*)inst;
38 | keyJoyVars* vars = ((keyJoyVars*)pl->data);
39 |
40 | vars->val=0;
41 | if (IsKeyDown(KEY_UP)) vars->val = vars->val | 128;
42 | if (IsKeyDown(KEY_DOWN)) vars->val = vars->val | 64;
43 | if (IsKeyDown(KEY_LEFT)) vars->val = vars->val | 32;
44 | if (IsKeyDown(KEY_RIGHT)) vars->val = vars->val | 16;
45 | if (IsKeyDown(KEY_U)) vars->val = vars->val | 8;
46 | if (IsKeyDown(KEY_I)) vars->val = vars->val | 4;
47 | if (IsKeyDown(KEY_O)) vars->val = vars->val | 2;
48 | if (IsKeyDown(KEY_P)) vars->val = vars->val | 1;
49 |
50 |
51 | BeginTextureMode(pl->outTx);
52 | ClearBackground(BLANK);
53 | DrawTexture(pl->plug->resTx, 0,0, WHITE);
54 |
55 | DrawTextEx(pl->plug->font, TextFormat("%02X ",vars->val), (Vector2){ 28, 48 }, 20, 2, BLACK);
56 | EndTextureMode();
57 | }
58 |
59 |
60 | // The following functions cannot access the UI
61 | G_MODULE_EXPORT void clicked(void* inst, int x, int y) { }
62 |
63 | // TODO put in plugInstStruct set in initialise
64 | G_MODULE_EXPORT int getAddressSize() { return 1; }
65 |
66 | // is is only called with a valid address for the device so
67 | // we don't need to check it (only 1 byte)
68 | G_MODULE_EXPORT byte getAddress(void* inst, int address)
69 | {
70 | plugInstStruct* pl = (plugInstStruct*)inst;
71 | keyJoyVars* vars = ((keyJoyVars*)pl->data);
72 | return vars->val;
73 | }
74 |
75 | G_MODULE_EXPORT void setAddress(void* inst, int address, byte data) { }
76 |
--------------------------------------------------------------------------------
/src/plugins/libRunStepSkip.c:
--------------------------------------------------------------------------------
1 |
2 | #include "plugin.h"
3 | #include
4 | #include
5 | #include "raylib.h"
6 | #include "raygui.h"
7 | #include
8 |
9 | /*
10 | * RunStepSkip plugin
11 | *
12 | * provides buttons allowing the user to control the emulation
13 | *
14 | *
15 | *
16 | */
17 |
18 |
19 | typedef struct {
20 | bool running;
21 | } rssVars;
22 |
23 |
24 | // set up
25 | G_MODULE_EXPORT void initialise(void* inst)
26 | {
27 | plugInstStruct* pl = (plugInstStruct*)inst;
28 | pl->data = malloc(sizeof(rssVars));
29 | rssVars* vars = ((rssVars*)pl->data);
30 | (void)vars;
31 |
32 | pl->size = (Vector2){256,32}; // size is always the same for all instances
33 | pl->outTx = LoadRenderTexture(pl->size.x, pl->size.y); // plugin should only draw on this
34 |
35 | SetTextureFilter(pl->outTx.texture, ICON_FILTER_BILINEAR);
36 |
37 | // clear out / initialize anything in vars like strings etc
38 | // vars->running = false;
39 | }
40 |
41 |
42 | G_MODULE_EXPORT void setProperty(void* inst, char* prop, void* value) { }
43 |
44 | // This function can access the UI
45 | G_MODULE_EXPORT void draw(void* inst)
46 | {
47 | // rendering takes place on plugin instances render texture.
48 | plugInstStruct* pl = (plugInstStruct*)inst;
49 | rssVars* vars = ((rssVars*)pl->data);
50 |
51 | SetMouseOffset(-pl->pos.x, -pl->pos.y); // TODO caller sets this ?
52 |
53 | BeginTextureMode(pl->outTx);
54 | ClearBackground(BLANK);
55 |
56 | // run stop button
57 | vars->running = isRunning(); // in case something else stops us (break plugin for example)
58 |
59 | if (vars->running) {
60 | GuiToggle((Rectangle){0,0,48,31}, "Stop", &vars->running);
61 | } else {
62 | GuiToggle((Rectangle){0,0,48,31}, "Run", &vars->running);
63 | }
64 |
65 | setRunning(vars->running);
66 |
67 |
68 | // step button
69 | if (GuiButton((Rectangle){52,0,48,31},"Step")) {
70 | doStep();
71 | }
72 |
73 | // skip button
74 | if (GuiButton((Rectangle){100,0,48,31},"Skip")) {
75 | doSkip();
76 | }
77 |
78 |
79 | EndTextureMode();
80 |
81 | SetMouseOffset(0, 0); // TODO caller sets this ?
82 |
83 | }
84 |
85 |
86 | // The following functions cannot access the UI
87 | G_MODULE_EXPORT void clicked(void* inst, int x, int y) { }
88 |
89 | // TODO put in plugInstStruct set in initialise
90 | G_MODULE_EXPORT int getAddressSize() { return 0; } // TODO important signals not memory mapped
91 |
92 | G_MODULE_EXPORT byte getAddress(void* inst, int address) { return 0xff; }
93 |
94 | G_MODULE_EXPORT void setAddress(void* inst, int address, byte data) { }
95 |
--------------------------------------------------------------------------------
/target/machines/machine1.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/src/plugins/libbreak.c:
--------------------------------------------------------------------------------
1 |
2 | #include "plugin.h"
3 | #include
4 | #include
5 | #include "raylib.h"
6 | #include "raygui.h"
7 | #include
8 |
9 | /*
10 | * break plugin
11 | *
12 | * provides a single field where by a breakpoint can be set
13 | * set to zero or some other unlikely address to "disable"
14 | *
15 | *
16 | *
17 | */
18 |
19 | typedef struct {
20 | unsigned int breakp;
21 | char breakstr[12];
22 | bool breakedit;
23 | char label[33];
24 | float fade;
25 | } breakVars;
26 |
27 |
28 | // set up
29 | G_MODULE_EXPORT void initialise(void* inst)
30 | {
31 | plugInstStruct* pl = (plugInstStruct*)inst;
32 | pl->data = malloc(sizeof(breakVars));
33 | breakVars* vars = ((breakVars*)pl->data);
34 |
35 | // does np2 really matter this day and age?
36 | pl->size = (Vector2){128,32}; // size is always the same for all instances
37 | pl->outTx = LoadRenderTexture(pl->size.x, pl->size.y); // plugin should only draw on this
38 |
39 | SetTextureFilter(pl->outTx.texture, ICON_FILTER_BILINEAR);
40 |
41 | // clear out / initialize anything in vars like strings etc
42 | vars->breakp = 0xffffffff;
43 | vars->breakedit = false;
44 | sprintf(vars->breakstr,"%08X",vars->breakp);
45 | }
46 |
47 |
48 | G_MODULE_EXPORT void setProperty(void* inst, char* prop, void* value) { }
49 |
50 | // This function can access the UI
51 | G_MODULE_EXPORT void draw(void* inst)
52 | {
53 | // rendering takes place on plugin instances render texture.
54 | plugInstStruct* pl = (plugInstStruct*)inst;
55 | breakVars* vars = ((breakVars*)pl->data);
56 |
57 | SetMouseOffset(-pl->pos.x, -pl->pos.y); // TODO caller sets this ?
58 | if (m68k_get_reg(NULL, M68K_REG_PC) == vars->breakp) {
59 | vars->fade+=0.1;
60 | // ?? GuiFade(0.9+(sin(vars->fade)*.1));
61 | }
62 |
63 | BeginTextureMode(pl->outTx);
64 | ClearBackground(BLANK);
65 | if ( GuiTextBox((Rectangle){0,0,127-32,31}, vars->breakstr, 9, vars->breakedit) ) {
66 | vars->breakedit=!vars->breakedit;
67 | if (!vars->breakedit) {
68 | vars->breakp = strtoul(vars->breakstr, NULL, 16);
69 | sprintf(vars->breakstr,"%08X",vars->breakp);
70 | setBreakPoint(vars->breakp);
71 | }
72 | }
73 | EndTextureMode();
74 | SetMouseOffset(0, 0); // caller set ?
75 | // ?? GuiFade(1); // caller set ?
76 | }
77 |
78 |
79 | // The following functions cannot access the UI
80 | G_MODULE_EXPORT void clicked(void* inst, int x, int y) { }
81 |
82 | // TODO put in plugInstStruct set in initialise
83 | G_MODULE_EXPORT int getAddressSize() { return 0; } // important signals gui plugin
84 |
85 | G_MODULE_EXPORT byte getAddress(void* inst, int address) { return 0xff; }
86 |
87 | G_MODULE_EXPORT void setAddress(void* inst, int address, byte data) { }
88 |
--------------------------------------------------------------------------------
/support/a68k/ToDo.txt:
--------------------------------------------------------------------------------
1 | Process (An,Dn) as 0(An,Dn)
2 |
3 | Wild optimizations? (e.g. MOVE.W #0,D0 -> CLR.W D0)
4 | (also CMP #0 -> TST, CLR.L Dn -> MOVEQ #0,Dn and maybe
5 | MOVE #0,An -> SUB An,An -- Kevin Kofler
6 | also LSL #1 -> ADD -- trazom)
7 |
8 | (MOVE.L #16,D0 -> MOVE.W #16,D0 -> MOVEQ #16,D0) ???
9 | (NOTE by Kevin Kofler: Paul Froissart's suggestion of a
10 | MOVEF instruction - see below - is a better idea).
11 |
12 | Anyway while working on the above I came up with a little wish list for A68k:
13 | 4) A jump/branch-conditional assembler op. 68000 branch (Bcc) instructions
14 | can only branch to a location +/- 32K away. What I would like to see in
15 | A68k are opcodes (i.e. JBxx) which would insert the necessary code to do
16 | a long jump if the target of the branch was greater than 32k away. This
17 | is only required for 68000 code of course since 68020's and up support
18 | 32 bit displacement. An example,
19 | JBEQ target ; branch if equal to target
20 | ; where target is a long
21 | ; way away
22 |
23 | the assembler would produce code equivalent to:
24 |
25 | BNE skip
26 | JMP target
27 | skip: ; next instruction
28 |
29 | I hope I have given you some ideas and I look forward to your next release of
30 | A68k.
31 |
32 | Cheers,
33 | Paul Gittings
34 |
35 |
36 | A GOTO directive to continue the assembly at a certain point.
37 | Add a movef pseudo-instruction :
38 | - movef #x,dn means if -128<=x<=127 then translate as moveq #x,dn otherwise
39 | translate it as move.w #x,dn (this can be done with a macro but the # has to
40 | be removed and EQU constants are not supported, only SET constants, possibly
41 | improve SET by supporting EQUs and make a SETIMM command which does not do
42 | anything if the command doesn't start with a #, and which SETs the variable
43 | otherwise, just like a SET without the #)
44 | Improve local labelling :
45 | - allow \_nxt_