mirror of https://github.com/anarkavre/pom1.git
Add Krusader ROM & make ROM user configurable
This commit is contained in:
parent
b46cb7b8ab
commit
efe842012a
|
@ -1,13 +1,19 @@
|
|||
*~
|
||||
INSTALL
|
||||
Makefile
|
||||
Makefile.in
|
||||
aclocal.m4
|
||||
autom4te.cache
|
||||
compile
|
||||
config.guess
|
||||
config.h
|
||||
config.h.in
|
||||
config.log
|
||||
config.status
|
||||
config.sub
|
||||
configure
|
||||
depcomp
|
||||
INSTALL
|
||||
install-sh
|
||||
Makefile
|
||||
Makefile.in
|
||||
ltmain.sh
|
||||
missing
|
||||
stamp-h1
|
||||
|
|
2
AUTHORS
2
AUTHORS
|
@ -1,3 +1,3 @@
|
|||
John D. Corrado <jdcorrado@gmail.com>
|
||||
Verhille Arnaud
|
||||
|
||||
Ralph Moeritz
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
2023-12-17 Ralph Moeritz
|
||||
|
||||
* Added -krusaderRom option (Ctrl+K) to switch between Krusader and BASIC/Monitor ROMs.
|
||||
|
||||
Sat Mar 03 12:21:45 EST 2012 jdcorrado
|
||||
|
||||
v1.0.0
|
||||
|
|
|
@ -2,7 +2,7 @@ DOC_FILES = \
|
|||
AUTHORS \
|
||||
ChangeLog \
|
||||
NEWS \
|
||||
README
|
||||
README.md
|
||||
|
||||
EXTRA_DIST = $(DOC_FILES)
|
||||
|
||||
|
|
34
README
34
README
|
@ -1,34 +0,0 @@
|
|||
Pom1 is an Apple 1 emulator being ported to C from the original Java
|
||||
version. It uses the Simple DirectMedia Layer library and works on most
|
||||
platforms.
|
||||
|
||||
== Options ==
|
||||
|
||||
Pom1 has many options to configure and utilize the emulator. They are
|
||||
accessed by Ctrl+<letter>. Some options also have corresponding command
|
||||
line parameters.
|
||||
|
||||
Option Letter Parameter Description
|
||||
--------------------------------------------------------------------------------------------
|
||||
Load Memory L Load memory from a binary or ascii file.
|
||||
Save Memory S Save memory to a binary or ascii file.
|
||||
Quit Q Quit the emulator.
|
||||
Reset R Soft reset the emulator.
|
||||
Hard Reset H Hard reset the emulator.
|
||||
Pixel Size P -pixelsize <n> Set the pixel size (1 or 2).
|
||||
Scanlines N -scanlines Turn scanlines on or off (pixel size 2 only).
|
||||
Terminal Speed T -terminalspeed <n> Set the terminal speed (Range: 1 - 120).
|
||||
RAM 8K E -ram8k Use only 8KB of RAM or entire 64KB of RAM.
|
||||
Write In ROM W -writeinrom Allow writing data in ROM or not.
|
||||
IRQ/BRK Vector V Set address of interrupt vector.
|
||||
Fullscreen F -fullscreen Switch to fullscreen or window.
|
||||
Blink Cursor B -blinkcursor Set the cursor to blink or not.
|
||||
Cursor Block C -blockcursor Set the cursor to block or @.
|
||||
Show About A Show version and copyright information.
|
||||
|
||||
== Other information ==
|
||||
|
||||
* You can find more information about the project at the Pom1 website:
|
||||
|
||||
http://pom1.sourceforge.net/
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
Pom1 is an Apple 1 emulator ported to C from the original Java
|
||||
version. It uses the SDL1 library and works on most platforms.
|
||||
|
||||
Options
|
||||
===
|
||||
|
||||
Pom1 has many options to configure and utilize the emulator. They are
|
||||
accessed by Ctrl+<letter>. Some options also have corresponding
|
||||
command line parameters.
|
||||
|
||||
| Option | Letter | Parameter | Description |
|
||||
|---------------------|--------|--------------------|------------------------------------------------|
|
||||
| Load Memory | L | | Load memory from a binary or ascii file. |
|
||||
| Save Memory | S | | Save memory to a binary or ascii file. |
|
||||
| Quit | Q | | Quit the emulator. |
|
||||
| Reset | R | | Soft reset the emulator. |
|
||||
| Hard Reset | H | | Hard reset the emulator. |
|
||||
| Pixel Size | P | -pixelsize <n> | Set the pixel size (1 or 2). |
|
||||
| Scanlines | N | -scanlines | Turn scanlines on or off (pixel size 2 only). |
|
||||
| Terminal Speed | T | -terminalspeed <n> | Set the terminal speed (Range: 1 - 120). |
|
||||
| RAM 8K | E | -ram8k | Use only 8KB of RAM or entire 64KB of RAM. |
|
||||
| Write In ROM | W | -writeinrom | Allow writing data in ROM or not. |
|
||||
| IRQ/BRK Vector | V | | Set address of interrupt vector. |
|
||||
| Fullscreen | F | -fullscreen | Switch to fullscreen or window. |
|
||||
| Blink Cursor | B | -blinkcursor | Set the cursor to blink or not. |
|
||||
| Cursor Block | C | -blockcursor | Set the cursor to block or @. |
|
||||
| Show About | A | | Show version and copyright information. |
|
||||
| Toggle Krusader ROM | K | -krusaderRom | Toggle between Krusader and BASIC/Monitor ROMs |
|
||||
|
||||
Before exiting, Pom1 writes its configuration options to `$HOME/.pom1/pom1.cfg`
|
||||
|
||||
Other information
|
||||
===
|
||||
|
||||
- You can find more information about the project at the Pom1 website: http://pom1.sourceforge.net/
|
|
@ -98,6 +98,8 @@ void loadConfiguration(void)
|
|||
setBlinkCursor(value[0] & 0x01);
|
||||
else if (!strcmp(buffer, "blockCursor"))
|
||||
setBlockCursor(value[0] & 0x01);
|
||||
else if (!strcmp(buffer, "krusaderRom"))
|
||||
setKrusaderRom((value[0] & 0x01));
|
||||
}
|
||||
|
||||
fclose(fp);
|
||||
|
@ -181,6 +183,12 @@ void saveConfiguration(void)
|
|||
buffer[14] = '\0';
|
||||
fputs(buffer, fp);
|
||||
|
||||
strcpy(buffer, "krusaderRom=");
|
||||
buffer[12] = getKrusaderRom() | 0x30;
|
||||
buffer[13] = '\n';
|
||||
buffer[14] = '\0';
|
||||
fputs(buffer, fp);
|
||||
|
||||
fclose(fp);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -192,6 +192,11 @@ int handleInput(void)
|
|||
showAbout();
|
||||
return 1;
|
||||
}
|
||||
else if (event.key.keysym.sym == SDLK_k) {
|
||||
setKrusaderRom(!getKrusaderRom());
|
||||
printf("stdout: krusaderRom=%d\n", getKrusaderRom());
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (readKbdCr() == 0x27 && !_fp && event.type == SDL_KEYDOWN && !(event.key.keysym.unicode & 0xFF80) && event.key.keysym.unicode)
|
||||
|
|
|
@ -62,9 +62,10 @@ int main(int argc, char *argv[])
|
|||
setPixelSize(temp);
|
||||
}
|
||||
}
|
||||
else if (!strcasecmp("-scanlines", argv[i]))
|
||||
else if (!strcasecmp("-scanlines", argv[i])) {
|
||||
if (getPixelSize() > 1)
|
||||
setScanlines(1);
|
||||
}
|
||||
else if (!strcasecmp("-terminalspeed", argv[i]) && i + 1 < argc)
|
||||
{
|
||||
temp = atoi(argv[i + 1]);
|
||||
|
@ -82,6 +83,8 @@ int main(int argc, char *argv[])
|
|||
setBlinkCursor(1);
|
||||
else if (!strcasecmp("-blockcursor", argv[i]))
|
||||
setBlockCursor(1);
|
||||
else if (!strcasecmp("-krusaderrom", argv[i]))
|
||||
setKrusaderRom(1);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
76
src/memory.c
76
src/memory.c
|
@ -21,9 +21,12 @@
|
|||
#include <string.h>
|
||||
#include "configuration.h"
|
||||
#include "pia6820.h"
|
||||
#include "memory.h"
|
||||
|
||||
static unsigned char mem[65536];
|
||||
static int ram8k = 0, writeInRom = 1;
|
||||
static unsigned char mem[0x10000]; // 64K
|
||||
static int ram8k = 0;
|
||||
static int writeInRom = 1;
|
||||
static int krusaderRom = 0;
|
||||
|
||||
static int loadMonitor(void)
|
||||
{
|
||||
|
@ -40,7 +43,7 @@ static int loadMonitor(void)
|
|||
|
||||
if (fp)
|
||||
{
|
||||
fread(&mem[0xFF00], 1, 256, fp);
|
||||
fread(&mem[0xFF00], 1, 0x100, fp);
|
||||
fclose(fp);
|
||||
}
|
||||
else
|
||||
|
@ -64,7 +67,7 @@ static int loadBasic(void)
|
|||
|
||||
if (fp)
|
||||
{
|
||||
fread(&mem[0xE000], 1, 4096, fp);
|
||||
fread(&mem[0xE000], 1, 0x1000, fp);
|
||||
fclose(fp);
|
||||
}
|
||||
else
|
||||
|
@ -73,22 +76,61 @@ static int loadBasic(void)
|
|||
return 1;
|
||||
}
|
||||
|
||||
static int loadKrusader() {
|
||||
const char *romdir = getRomDirectory();
|
||||
char *filename;
|
||||
FILE *fp;
|
||||
|
||||
filename = (char *)malloc(strlen(romdir) + 14);
|
||||
sprintf(filename, "%s/krusader.rom", romdir);
|
||||
|
||||
fp = fopen(filename, "rb");
|
||||
|
||||
free(filename);
|
||||
|
||||
if (fp) {
|
||||
fread(&mem[0xE000], 1, 0x2000, fp);
|
||||
fclose(fp);
|
||||
}
|
||||
else {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void loadRoms() {
|
||||
if (krusaderRom) {
|
||||
if (!loadKrusader()) {
|
||||
fprintf(stderr, "stderr: Could not load krusader\n");
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (!loadMonitor()) {
|
||||
fprintf(stderr, "stderr: Could not load monitor\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (!loadBasic()) {
|
||||
fprintf(stderr, "stderr: Could not load basic\n");
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int getKrusaderRom() {
|
||||
return krusaderRom;
|
||||
}
|
||||
|
||||
void setKrusaderRom(int b) {
|
||||
krusaderRom = b;
|
||||
}
|
||||
|
||||
void resetMemory(void)
|
||||
{
|
||||
memset(mem, 0, 57344);
|
||||
|
||||
if (!loadMonitor())
|
||||
{
|
||||
fprintf(stderr, "stderr: Could not load monitor\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (!loadBasic())
|
||||
{
|
||||
fprintf(stderr, "stderr: Could not load basic\n");
|
||||
exit(1);
|
||||
}
|
||||
memset(mem, 0, 0xE000);
|
||||
loadRoms();
|
||||
}
|
||||
|
||||
void setRam8k(int b)
|
||||
|
|
|
@ -19,6 +19,8 @@
|
|||
#ifndef __MEMORY_H__
|
||||
#define __MEMORY_H__
|
||||
|
||||
int getKrusaderRom();
|
||||
void setKrusaderRom(int b);
|
||||
void resetMemory(void);
|
||||
void setRam8k(int b);
|
||||
int getRam8k(void);
|
||||
|
|
|
@ -2,4 +2,7 @@
|
|||
|
||||
export POM1ROMDIR="@prefix@/share/@PACKAGE@/roms"
|
||||
|
||||
pom1-@PACKAGE_VERSION@ $@
|
||||
SCRIPT=$(readlink -f "$0")
|
||||
SCRIPTDIR=$(dirname "$SCRIPT")
|
||||
|
||||
$SCRIPTDIR/pom1-@PACKAGE_VERSION@ $@
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
ROMFILES = \
|
||||
basic.rom \
|
||||
charmap.rom \
|
||||
monitor.rom
|
||||
monitor.rom \
|
||||
krusader.rom
|
||||
|
||||
romdir = $(prefix)/share/@PACKAGE@/roms
|
||||
rom_DATA = $(ROMFILES)
|
||||
|
|
Binary file not shown.
Loading…
Reference in New Issue