Compare commits

...

36 Commits
0.1b ... master

Author SHA1 Message Date
ArthurFerreira2
b272efd8e3
Update puce6502.h 2023-09-10 12:50:02 +02:00
ArthurFerreira2
fe9b6f28b6
Update reinetteII+.c 2023-09-10 12:49:48 +02:00
ArthurFerreira2
e213ebacdd
Update puce6502.c 2023-09-10 12:49:26 +02:00
ArthurFerreira2
3342915985
Update README.md 2021-06-25 00:27:41 +02:00
ArthurFerreira2
8a6f8af6e8
stable version 2021-06-24 22:55:47 +02:00
ArthurFerreira2
5596f245fb
Delete Lode Runner.nib 2021-05-26 22:07:56 +02:00
ArthurFerreira2
90011f394e
Delete Ms. Pacman.nib 2021-05-26 22:07:46 +02:00
ArthurFerreira2
43402cff22
Delete DOS3.3 Blank.nib 2020-09-07 14:55:15 +02:00
ArthurFerreira2
d574c661fa
Delete reinetteII+.res 2020-09-07 14:53:26 +02:00
ArthurFerreira2
891e9c35cc
Delete reinetteII+.exe 2020-09-07 14:53:05 +02:00
ArthurFerreira2
b6002de8db v0.4c 2020-09-07 14:40:32 +02:00
ArthurFerreira2
ad586e79f5
Update puce6502.h 2020-09-06 23:34:52 +02:00
ArthurFerreira2
28fa0f62bc
Update reinetteII+.c 2020-09-06 23:34:02 +02:00
ArthurFerreira2
d309a5e5e7
Update README.md 2020-09-06 00:50:53 +02:00
ArthurFerreira2
bb4c4f0f9a
v0.4 stable 2020-09-06 00:40:24 +02:00
ArthurFerreira2
68436adb8b
updated link to windows binaries 2020-08-18 19:26:19 +02:00
ArthurFerreira2
6d22f5d677
added compilation options 2020-08-17 18:45:24 +02:00
ArthurFerreira2
40563bb731
Delete screenshots.png 2020-08-17 18:40:59 +02:00
ArthurFerreira2
1e32765c2b
Delete font-reverse.bmp 2020-08-17 18:40:40 +02:00
ArthurFerreira2
978977da6f
Delete font-normal.bmp 2020-08-17 18:40:24 +02:00
ArthurFerreira2
621cbf1831
Delete diskII.rom 2020-08-17 18:40:17 +02:00
ArthurFerreira2
e2495be354
Delete appleII+.rom 2020-08-17 18:40:10 +02:00
ArthurFerreira2
b3f7b2e8b7
Delete appleII.rom 2020-08-17 18:40:02 +02:00
ArthurFerreira2
b6681cf119
Delete DOS3.3.nib 2020-08-17 18:39:44 +02:00
ArthurFerreira2
121850b76c
joystick and sound enhancements 2020-08-17 18:39:06 +02:00
ArthurFerreira2
8cd9263453
Function keys updated 2020-08-14 21:42:31 +02:00
ArthurFerreira2
3a79269dc0
removed unnecessary debug routines 2020-08-14 18:36:27 +02:00
ArthurFerreira2
f01216aba2
corrected numerous bus 2020-08-14 18:29:12 +02:00
ArthurFerreira2
441c22151b
using the HGR engine from v0.2b 2020-08-10 23:14:14 +02:00
ArthurFerreira2
3f9411f460
Delete screenshots.png 2020-08-10 23:13:31 +02:00
ArthurFerreira2
26dbd25bf2
Using the new HGR engine 2020-08-10 23:12:24 +02:00
ArthurFerreira2
8c2c38d6ed
v0.2b
fixed HGR fringing
fixed fwrite / fclose causing SEG faults under Linux
added monochrome switch - only for HRG
Function keys have been re-mapped - see README.md for details
you can save disk 0 and disk 1 now
disk filesnames are now displayed on the title bar
added puce6502DumpRegs() and puce6502DumpPage() for troubleshooting
cleaned code, added more comments
2020-08-10 23:09:33 +02:00
ArthurFerreira2
ccde0f5ece
Update README.md 2020-08-09 10:21:40 +02:00
ArthurFerreira2
9c13f1f5a0
Update README.md 2020-08-09 10:20:31 +02:00
ArthurFerreira2
0617bd8b47
Update README.md 2020-08-09 10:19:48 +02:00
ArthurFerreira2
145c806a26
added link to windows binaries 2020-08-09 02:26:12 +02:00
21 changed files with 2900 additions and 1046 deletions

View File

1
DOS3.3 Blank.nib generated

File diff suppressed because one or more lines are too long

View File

@ -1,10 +1,15 @@
LIBS = -lSDL2
FLAGS = -std=c99 -pedantic -Wpedantic -Wall -Werror -O3
# comment this line if you are under Linux
LIBS-WIN32 = -lmingw32 -lSDL2main -Wl,-subsystem,windows
CC = gcc
FLAGS = -std=c11 -pedantic -Wpedantic -Wall -O3
reinetteII+: reinetteII+.c puce6502.c
$(CC) $^ $(FLAGS) $(LIBS-WIN32) $(LIBS) -o $@
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)
$(CC) $^ $(FLAGS) $(WIN32-LIBS) $(LIBS) -o $@
reinetteII+.res: reinetteII+.rc
windres $^ -O coff -o $(WIN32-RES)
all: reinetteII+

View File

@ -2,99 +2,110 @@
### reinette goes graphical !
![screenshots](screenshots.png)
![screenshots](assets/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)
### Featuring :
* all video modes in color
* mono sound with mute/unmute
* 48KB (no language card support)
* paddles/joystic with trim ajustment
* 64KB (language card support)
* paddles/joystick with trim adjustment
* paste text from clipboard
* 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
* zoom the window by integer increments
* screen scaling by integer increments
* easy screenshot
It uses the same MOS 6502 CPU emulator as her sisters (now christened [puce6502](https://github.com/ArthurFerreira2/puce6502)).\
It uses an optimized and accurate MOS 6502 CPU emulator (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)
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.
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, less than 1000 SLOC, with two source files only, one for the CPU emulation, the other for the computer itself.
It's compact, 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).
### Startup
You can specify a .nib file on the command line to start the emulator with a floppy engaged in drive 1. Otherwhise, the emulator will start with no floppy (and thus wait one until you press the reset key or drag and drop a nib file)
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)
### Usage
Drag and drop a disk image file (.nib format only) to inset it into drive 1\
Drop the file while pressing the ALT key to insert it into drive 2
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.\
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 : writes the changes of the floppy in current drive back to host
* F4 : paste text from clipboard
* F5 : zoom out down to 1:1
* F6 : zoom in, no magnification limit
* F7/F8 : adjust joystic trim
* F9 : mute/unmute soud
* F10 : reset
* F11 : break
* F12 : quit (you can also just close the window)
* F1 : display save how to
* ctrl F1 : writes the changes of the floppy in drive 0 back to host
* alt F1 : writes the changes of the floppy in drive 1 back to host
* F2 : save a screenshot into the screenshots directory
* F3 : paste text from clipboard
* F4 : mute / unmute sound
* shift F4 : increase volume
* ctrl F4 : decrease volume
* F5 : reset joystick release speed,
* shift F5 : increase joystick release speed
* crtl F5 : decrease joystick release speed,
* F6 : reset joystick action speed,
* 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 / Joystic :
Paddles / Joystick :
* numpad 1 : left
* numpad 3 : right
* numpad 5 : up
* numpad 2 : down
* numpad 3 : up
* CTRL : button 0
* ALT : button 1
* SHIFT : button 2 (allow applications to use the shift mod)
```
### Limitations
* high pitch noise at high volume (might be related with my environment)
* sound cracks when playing for long period (intro music for example)
* CPU is not 100% cycle accurate - see source file for more details
* ~~high pitch noise at high volume on windows (Linux Ubuntu tested OK)~~
* ~~sound cracks when playing for long period (intro music for example)~~
* ~~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)
* HGR video is inaccurate, and does not implement color clashing
* disk ][ access is artificially accelerated
* ~~HGR video is inaccurate, and does not implement color fringing~~
* ~~disk ][ access is artificially accelerated~~ - considered as a feature
* 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 some software requiring the language card)
* ~~only has 48KB of RAM (can't run software requiring the language card)~~
* and many others ...
### To do
### To do :
* ~~fix sound cracks~~
* give a warning if the application exits with unsaved floppy changes
* 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 clashing in HGR
* optimize sound generation
* optimize disk access (speed is actually a bit artificial)
* re-implement Paddles and Joystic support for a better analog simulation
* implement the language card and extend the RAM of **reinette II plus** to 64K to support more sofware.
* check for more accurate RGB values.
* ~~implement color fringe effect in HGR~~
* ~~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 :
* add the ability to insert a binary file at a specified address
* dump regs, soft swithes and specified memory pages to console
* give the user the option to start with the original Apple II rom
* dump regs, soft switches and specified memory pages to console
Follow me to keep updated !
\
\
\

View File

Before

Width:  |  Height:  |  Size: 958 B

After

Width:  |  Height:  |  Size: 958 B

View File

Before

Width:  |  Height:  |  Size: 958 B

After

Width:  |  Height:  |  Size: 958 B

BIN
assets/reinetteII+.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

BIN
assets/screenshots.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 794 KiB

2466
puce6502.c

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,13 @@
/*
Puce6502 - MOS 6502 cpu emulator
Last modified 1st of August 2020
Copyright (c) 2018 Arthur Ferreira (arthur.ferreira2@gmail.com)
Copyright (c) 2018 Arthur Ferreira
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
of this software and associated documentation files (the "Software"), to deal
@ -22,24 +28,24 @@
THE SOFTWARE.
*/
#ifndef _CPU_H
#define _CPU_H
#ifndef _PUCE6502_H
#define _PUCE6502_H
typedef unsigned char uint8_t;
typedef unsigned short uint16_t;
typedef enum {false, true} bool;
typedef enum { false, true } bool;
#define ROMSTART 0xD000
#define ROMSIZE 0x3000
#define RAMSIZE 0xC000
extern unsigned long long int ticks;
uint8_t rom[ROMSIZE];
uint8_t ram[RAMSIZE];
uint16_t puce6502Exec(unsigned long long int cycleCount);
void puce6502RST();
void puce6502IRQ();
void puce6502NMI();
long long int ticks;
// void printRegs();
// void dasm(uint16_t address);
// void setPC(uint16_t address);
// uint16_t getPC();
void puce6502Exec(long long int cycleCount);
void puce6502Reset();
void puce6502Break();
void puce6502Goto(uint16_t address);
#endif

File diff suppressed because it is too large Load Diff

24
reinetteII+.rc Normal file
View File

@ -0,0 +1,24 @@
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 Normal file

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 842 KiB

BIN
screenshots/Lode Runner.bmp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 630 KiB

BIN
screenshots/Ms. Pac-Man.bmp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 630 KiB

BIN
screenshots/Ms. Pacman.bmp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 630 KiB

BIN
screenshots/no disk.bmp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 630 KiB