Compare commits
No commits in common. "master" and "0.2b" have entirely different histories.
1
DOS3.3 Blank.nib
generated
Normal file
0
DOS 3.3.nib → DOS3.3.nib
generated
18
Makefile
@ -1,15 +1,13 @@
|
|||||||
CC = gcc
|
|
||||||
FLAGS = -std=c11 -pedantic -Wpedantic -Wall -O3
|
|
||||||
|
|
||||||
LIBS = -lSDL2
|
LIBS = -lSDL2
|
||||||
# comment these two lines if you are under Linux :
|
|
||||||
WIN32-LIBS = -lmingw32 -lSDL2main -Wl,-subsystem,windows
|
|
||||||
WIN32-RES = reinetteII+.res
|
|
||||||
|
|
||||||
reinetteII+: reinetteII+.c puce6502.c $(WIN32-RES)
|
FLAGS = -std=c99 -pedantic -Wpedantic -Wall -O3 -Werror
|
||||||
$(CC) $^ $(FLAGS) $(WIN32-LIBS) $(LIBS) -o $@
|
|
||||||
|
|
||||||
reinetteII+.res: reinetteII+.rc
|
# comment this line if you are under Linux
|
||||||
windres $^ -O coff -o $(WIN32-RES)
|
LIBS-WIN32 = -lmingw32 -lSDL2main -Wl,-subsystem,windows
|
||||||
|
|
||||||
|
CC = gcc
|
||||||
|
|
||||||
|
reinetteII+: reinetteII+.c puce6502.c
|
||||||
|
$(CC) $^ $(FLAGS) $(LIBS-WIN32) $(LIBS) -o $@
|
||||||
|
|
||||||
all: reinetteII+
|
all: reinetteII+
|
||||||
|
86
README.md
@ -2,110 +2,104 @@
|
|||||||
|
|
||||||
### reinette goes graphical !
|
### reinette goes graphical !
|
||||||
|
|
||||||
![screenshots](assets/screenshots.png)
|
![screenshots](screenshots.png)
|
||||||
|
|
||||||
After [reinette](https://github.com/ArthurFerreira2/reinette) (Apple 1 emulator) and [reinette II](https://github.com/ArthurFerreira2/reinette-II) (the text only Apple II emulator), I am proud to release **reinette II plus**, a French\* Apple II plus emulator using SDL2.
|
After [reinette](https://github.com/ArthurFerreira2/reinette) (Apple 1 emulator) and [reinette II](https://github.com/ArthurFerreira2/reinette-II) (the text only Apple II emulator), I am proud to release **reinette II plus**, a french\* Apple II plus emulator using SDL2.
|
||||||
|
|
||||||
\* reinette has two meanings in French : it's a little frog but also a delicious kind of apple
|
\* reinette has two meanings in french : it's a little frog but also a delicious kind of apple
|
||||||
|
|
||||||
[download windows binaries](https://github.com/ArthurFerreira2/reinette-II-plus/releases/tag/0.4)
|
[download windows binaries](https://github.com/ArthurFerreira2/reinette-II-plus/releases/tag/0.2b)
|
||||||
|
|
||||||
### Featuring :
|
### Featuring :
|
||||||
|
|
||||||
* all video modes in color
|
* all video modes in color
|
||||||
* mono sound with mute/unmute
|
* mono sound with mute/unmute
|
||||||
* 64KB (language card support)
|
* 48KB (no language card support)
|
||||||
* paddles/joystick with trim adjustment
|
* paddles/joystick with trim adjustment
|
||||||
* paste text from clipboard
|
* paste text from clipboard
|
||||||
* disk ][ adapter with two drives (.nib files only)
|
* disk ][ adapter with two drives (.nib files only)
|
||||||
* drag and drop .nib files to inset a floppy
|
* drag and drop .nib files to inset a floppy
|
||||||
* save floppy changes back to host
|
* save floppy changes back to host
|
||||||
* screen scaling by integer increments
|
* screen scaling by integer increments
|
||||||
* easy screenshot
|
|
||||||
|
|
||||||
|
|
||||||
It uses an optimized and accurate MOS 6502 CPU emulator (now christened [puce6502](https://github.com/ArthurFerreira2/puce6502)).\
|
It uses the same MOS 6502 CPU emulator as her sisters (now christened [puce6502](https://github.com/ArthurFerreira2/puce6502)).\
|
||||||
You only need SDL2 to compile it. (I'm not using SDL_Mixer, but only the native SDL2 audio functions)
|
You only need SDL2 to compile it. (I'm not using SDL_Mixer, but only the native SDL2 audio functions)
|
||||||
|
|
||||||
|
|
||||||
This emulator is not accurate in many ways and does not compete with
|
This emulator is not accurate in many ways and does not compete with
|
||||||
[AppleWin](https://github.com/AppleWin/AppleWin), [Epple](https://github.com/cmosher01/Epple-II) or [LinApple](https://github.com/linappleii/linapple). Better use one of them if you want a good Apple ][ emulation experience.
|
[AppleWin](https://github.com/AppleWin/AppleWin), [Epple](https://github.com/cmosher01/Epple-II) or [LinApple](https://github.com/linappleii/linapple). Better use one of them if you want a good Apple ][ emulation experience.
|
||||||
|
|
||||||
I wrote it with the goal to better understand the Apple ][ internals, and I'm publishing the sources in the hope they will be of any help.
|
I wrote it with the goal to better understand the Apple ][ internals, and I'm publishing the sources in the hope they will be of any help.
|
||||||
|
|
||||||
It's compact, with two source files only, one for the CPU emulation, the other for the computer itself.
|
It's compact, less than 1000 SLOC, with two source files only, one for the CPU emulation, the other for the computer itself.
|
||||||
|
|
||||||
I did my best to comment the code, and if you have an idea of how an Apple ][ works, it should be easy for you to understand the code, modify and enhance it for your needs (see TODO section).
|
I did my best to comment the code, and if you have an idea of how an Apple ][ works, it should be easy for you to understand the code, modify and enhance it for your needs (see TODO section).
|
||||||
|
|
||||||
|
|
||||||
### Startup
|
### Startup
|
||||||
|
|
||||||
You can specify a .nib file at the command line to start the emulator with a floppy engaged in drive 1. Otherwise, the emulator will start with no floppy (and thus waits until you press the reset key or drag and drop a .nib file)
|
You can specify a .nib file on the command line to start the emulator with a floppy engaged in drive 1. Otherwise, the emulator will start with no floppy (and thus wait one until you press the reset key or drag and drop a .nib file)
|
||||||
|
|
||||||
|
|
||||||
### Usage
|
### Usage
|
||||||
|
|
||||||
Drag and drop a disk image file (.nib format only) to insert it into drive 1\
|
Drag and drop a disk image file (.nib format only) to insert it into drive 1\
|
||||||
**reinette II plus** will reboot immediately and try to boot the floppy.\
|
Drop the file while pressing the ALT key to insert it into drive 2
|
||||||
Press CTRL while dropping the file if you don't want the emulator to reboot \
|
|
||||||
Pressing the ALT key while dropping the file inserts it into drive 2.
|
|
||||||
|
|
||||||
Use the functions keys to control the emulator itself :
|
Use the functions keys to control the emulator itself
|
||||||
```
|
```
|
||||||
* F1 : display save how to
|
* F1 : writes the changes of the floppy in drive 0 back to host
|
||||||
* ctrl F1 : writes the changes of the floppy in drive 0 back to host
|
* F2 : writes the changes of the floppy in drive 1 back to host
|
||||||
* alt F1 : writes the changes of the floppy in drive 1 back to host
|
* F3 : pause / un-pause the emulator
|
||||||
* F2 : save a screenshot into the screenshots directory
|
* F4 : paste text from clipboard
|
||||||
* F3 : paste text from clipboard
|
* F5 : zoom out down to 1:1 pixels
|
||||||
* F4 : mute / unmute sound
|
* F6 : zoom in, no magnification limit
|
||||||
* shift F4 : increase volume
|
* F7/F8 : adjust joystick trim
|
||||||
* ctrl F4 : decrease volume
|
* F9 : mute / un-mute sound
|
||||||
* F5 : reset joystick release speed,
|
* F10 : monochrome / color display (only in HGR mode)
|
||||||
* shift F5 : increase joystick release speed
|
* F11 : reset
|
||||||
* crtl F5 : decrease joystick release speed,
|
* CTRL-F11 : break
|
||||||
* F6 : reset joystick action speed,
|
* F12 : quit the emulator
|
||||||
* shift F6 : increase joystick action speed
|
|
||||||
* crtl F6 : decrease joystick action speed,
|
|
||||||
* F7 : reset the zoom to 2:1
|
|
||||||
* shift F7 : increase zoom up to 8:1 max
|
|
||||||
* ctrl F7 : decrease zoom down to 1:1 pixels
|
|
||||||
* F10 : pause / un-pause the emulator
|
|
||||||
* F11 : reset
|
|
||||||
* F12 : about, help
|
|
||||||
|
|
||||||
Paddles / Joystick :
|
Paddles / Joystic :
|
||||||
|
|
||||||
* numpad 1 : left
|
* numpad 1 : left
|
||||||
* numpad 3 : right
|
* numpad 3 : right
|
||||||
* numpad 5 : up
|
|
||||||
* numpad 2 : down
|
* numpad 2 : down
|
||||||
|
* numpad 3 : up
|
||||||
* CTRL : button 0
|
* CTRL : button 0
|
||||||
* ALT : button 1
|
* ALT : button 1
|
||||||
* SHIFT : button 2 (allow applications to use the shift mod)
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### Limitations
|
### Limitations
|
||||||
|
|
||||||
* ~~high pitch noise at high volume on windows (Linux Ubuntu tested OK)~~
|
* high pitch noise at high volume on windows (Linux Ubuntu tested OK)
|
||||||
* ~~sound cracks when playing for long period (intro music for example)~~
|
* sound cracks when playing for long period (intro music for example)
|
||||||
* ~~CPU is not 100% cycle accurate - see source file for more details~~
|
* CPU is not 100% cycle accurate - see source file for more details
|
||||||
* colors are approximate (taken from a scan of an old Beagle bros. poster)
|
* colors are approximate (taken from a scan of an old Beagle bros. poster)
|
||||||
* ~~HGR video is inaccurate, and does not implement color fringing~~
|
* ~~HGR video is inaccurate, and does not implement color fringing~~
|
||||||
* ~~disk ][ access is artificially accelerated~~ - considered as a feature
|
* disk ][ access is artificially accelerated
|
||||||
* only support .nib floppy images. (you can use [CiderPress](https://github.com/fadden/ciderpress) to convert your images to this format)
|
* only support .nib floppy images. (you can use [CiderPress](https://github.com/fadden/ciderpress) to convert your images to this format)
|
||||||
* ~~only has 48KB of RAM (can't run software requiring the language card)~~
|
* only has 48KB of RAM (can't run software requiring the language card)
|
||||||
* and many others ...
|
* and many others ...
|
||||||
|
|
||||||
|
|
||||||
### To do
|
### To do
|
||||||
|
|
||||||
* ~~fix sound cracks~~
|
|
||||||
* give a warning if the application exits with unsaved floppy changes
|
* give a warning if the application exits with unsaved floppy changes
|
||||||
* check for more accurate RGB values.
|
* give the user the option to start with the original Apple II rom
|
||||||
|
* colors where taken from an old Beagle Bros poster, find more accurate RGB values.
|
||||||
* ~~implement color fringe effect in HGR~~
|
* ~~implement color fringe effect in HGR~~
|
||||||
* ~~re-implement Paddles and Joystick support for analog simulation~~
|
* optimize sound generation
|
||||||
* ~~implement the language card and extend the RAM of **reinette II plus** to 64K to support more software.~~
|
* optimize disk access (speed is actually a bit artificial)
|
||||||
|
* re-implement Paddles and Joystick support for analog simulation
|
||||||
|
* implement the language card and extend the RAM of **reinette II plus** to 64K to support more software.
|
||||||
* for 6502 coders :
|
* for 6502 coders :
|
||||||
* add the ability to insert a binary file at a specified address
|
* add the ability to insert a binary file at a specified address
|
||||||
* give the user the option to start with the original Apple II rom
|
|
||||||
* dump regs, soft switches and specified memory pages to console
|
* dump regs, soft switches and specified memory pages to console
|
||||||
|
|
||||||
|
Follow me to be updated !
|
||||||
\
|
\
|
||||||
\
|
\
|
||||||
\
|
\
|
||||||
|
Before Width: | Height: | Size: 60 KiB |
Before Width: | Height: | Size: 958 B After Width: | Height: | Size: 958 B |
Before Width: | Height: | Size: 958 B After Width: | Height: | Size: 958 B |
2519
puce6502.c
37
puce6502.h
@ -1,13 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
Puce6502 - MOS 6502 cpu emulator
|
Puce6502 - MOS 6502 cpu emulator
|
||||||
Last modified 1st of August 2020
|
Last modified 1st of August 2020
|
||||||
Copyright (c) 2018 Arthur Ferreira
|
Copyright (c) 2018 Arthur Ferreira (arthur.ferreira2@gmail.com)
|
||||||
|
|
||||||
This version has been modified for Reinette II plus, a french Apple II plus
|
|
||||||
emulator using SDL2 (https://github.com/ArthurFerreira2/reinette-II-plus).
|
|
||||||
|
|
||||||
Please download the latest version from
|
|
||||||
https://github.com/ArthurFerreira2/puce6502
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
@ -28,24 +22,27 @@
|
|||||||
THE SOFTWARE.
|
THE SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifndef _CPU_H
|
||||||
#ifndef _PUCE6502_H
|
#define _CPU_H
|
||||||
#define _PUCE6502_H
|
|
||||||
|
|
||||||
typedef unsigned char uint8_t;
|
typedef unsigned char uint8_t;
|
||||||
typedef unsigned short uint16_t;
|
typedef unsigned short uint16_t;
|
||||||
typedef enum { false, true } bool;
|
typedef enum {false, true} bool;
|
||||||
|
|
||||||
extern unsigned long long int ticks;
|
#define ROMSTART 0xD000
|
||||||
|
#define ROMSIZE 0x3000
|
||||||
|
#define RAMSIZE 0xC000
|
||||||
|
|
||||||
uint16_t puce6502Exec(unsigned long long int cycleCount);
|
uint8_t rom[ROMSIZE];
|
||||||
void puce6502RST();
|
uint8_t ram[RAMSIZE];
|
||||||
void puce6502IRQ();
|
|
||||||
void puce6502NMI();
|
|
||||||
|
|
||||||
// void printRegs();
|
long long int ticks;
|
||||||
// void dasm(uint16_t address);
|
|
||||||
// void setPC(uint16_t address);
|
void puce6502Exec(long long int cycleCount);
|
||||||
// uint16_t getPC();
|
void puce6502Reset();
|
||||||
|
void puce6502Break();
|
||||||
|
void puce6502Goto(uint16_t address);
|
||||||
|
void puce6502DumpRegs();
|
||||||
|
void puce6502DumpPage(uint8_t page, uint8_t pageCount);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
1530
reinetteII+.c
@ -1,24 +0,0 @@
|
|||||||
1 ICON "assets/reinetteII+.ico"
|
|
||||||
1 VERSIONINFO
|
|
||||||
FILEVERSION 0,4,8,0
|
|
||||||
PRODUCTVERSION 0,4,8,0
|
|
||||||
BEGIN
|
|
||||||
BLOCK "StringFileInfo"
|
|
||||||
BEGIN
|
|
||||||
BLOCK "040904E4"
|
|
||||||
BEGIN
|
|
||||||
VALUE "CompanyName", "Arthur Ferreira"
|
|
||||||
VALUE "FileDescription", "Apple II+ emulator"
|
|
||||||
VALUE "FileVersion", "0.4.8.0"
|
|
||||||
VALUE "InternalName", "reinette II plus"
|
|
||||||
VALUE "LegalCopyright", "Arthur Ferreira"
|
|
||||||
VALUE "OriginalFilename", "reinetteII+.exe"
|
|
||||||
VALUE "ProductName", "reinette II plus"
|
|
||||||
VALUE "ProductVersion", "0.4.8.0"
|
|
||||||
END
|
|
||||||
END
|
|
||||||
BLOCK "VarFileInfo"
|
|
||||||
BEGIN
|
|
||||||
VALUE "Translation", 0x409, 1252
|
|
||||||
END
|
|
||||||
END
|
|
BIN
reinetteII+.res
BIN
screenshots HGR v1/aquatron.png
Normal file
After Width: | Height: | Size: 5.1 KiB |
BIN
screenshots HGR v1/boulder dash.png
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
screenshots HGR v1/crossfire.png
Normal file
After Width: | Height: | Size: 6.8 KiB |
BIN
screenshots HGR v1/dig dug.png
Normal file
After Width: | Height: | Size: 9.0 KiB |
BIN
screenshots HGR v1/elite.png
Normal file
After Width: | Height: | Size: 8.4 KiB |
BIN
screenshots HGR v1/frogger II.png
Normal file
After Width: | Height: | Size: 16 KiB |
BIN
screenshots HGR v1/joust.png
Normal file
After Width: | Height: | Size: 9.3 KiB |
BIN
screenshots HGR v1/mario bros.png
Normal file
After Width: | Height: | Size: 7.7 KiB |
BIN
screenshots HGR v1/moon patrol.png
Normal file
After Width: | Height: | Size: 14 KiB |
BIN
screenshots HGR v1/mr robot.png
Normal file
After Width: | Height: | Size: 17 KiB |
BIN
screenshots HGR v1/ms pacman.png
Normal file
After Width: | Height: | Size: 8.4 KiB |
BIN
screenshots HGR v1/mystery house.png
Normal file
After Width: | Height: | Size: 9.0 KiB |
BIN
screenshots HGR v1/pinball construction set.png
Normal file
After Width: | Height: | Size: 9.5 KiB |
BIN
screenshots HGR v1/robotron 2048.png
Normal file
After Width: | Height: | Size: 5.5 KiB |
BIN
screenshots HGR v1/sabotage.png
Normal file
After Width: | Height: | Size: 4.1 KiB |
BIN
screenshots HGR v1/tetris.png
Normal file
After Width: | Height: | Size: 15 KiB |
BIN
screenshots HGR v2/aquatron.png
Normal file
After Width: | Height: | Size: 7.4 KiB |
BIN
screenshots HGR v2/boulder dash.png
Normal file
After Width: | Height: | Size: 16 KiB |
BIN
screenshots HGR v2/crossfire.png
Normal file
After Width: | Height: | Size: 9.1 KiB |
BIN
screenshots HGR v2/dig dug.png
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
screenshots HGR v2/elite.png
Normal file
After Width: | Height: | Size: 10 KiB |
BIN
screenshots HGR v2/frogger II.png
Normal file
After Width: | Height: | Size: 21 KiB |
BIN
screenshots HGR v2/joust.png
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
screenshots HGR v2/mario bros.png
Normal file
After Width: | Height: | Size: 9.7 KiB |
BIN
screenshots HGR v2/moon patrol.png
Normal file
After Width: | Height: | Size: 17 KiB |
BIN
screenshots HGR v2/mr robot.png
Normal file
After Width: | Height: | Size: 22 KiB |
BIN
screenshots HGR v2/ms pacman.png
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
screenshots HGR v2/mystery house.png
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
screenshots HGR v2/pinball construction set.png
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
screenshots HGR v2/robotron 2048.png
Normal file
After Width: | Height: | Size: 8.4 KiB |
BIN
screenshots HGR v2/sabotage.png
Normal file
After Width: | Height: | Size: 7.0 KiB |
BIN
screenshots HGR v2/tetris.png
Normal file
After Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 794 KiB After Width: | Height: | Size: 794 KiB |
Before Width: | Height: | Size: 630 KiB |
Before Width: | Height: | Size: 630 KiB |
Before Width: | Height: | Size: 630 KiB |
Before Width: | Height: | Size: 630 KiB |