Add code to handle buggy double lores HW on the Apple //e card for the Mac. Apparently it doesn't handle the colour shifting that is required in the aux bank on other Apple // HW.

This commit is contained in:
Jeremy Rand 2020-03-23 23:28:28 -04:00
parent d3d97db1f6
commit 49ccd2bfdc
5 changed files with 40 additions and 8 deletions

View File

@ -19,6 +19,13 @@ extern void __fastcall__ clearDblLoRes(void);
extern void __fastcall__ unshowDblLoRes(void);
extern void __fastcall__ mixedTextMode(void);
// The Apple //e card does not implement double lores correctly. The colours
// used on the aux bank need to be shifted but the //e card expects unshifted
// colour values (ie the same as those on the main. This function is called
// when the game detects it is runing on a //e card which causes the graphics
// routines to use the same colours in the main and aux banks.
extern void __fastcall__ setBuggyDblLoRes(void);
extern void __fastcall__ drawBgSquare(tSquare square);
extern void __fastcall__ drawGem(tSquare square);

View File

@ -17,6 +17,8 @@
.export _explodeGemFrame1, _explodeGemFrame2
.export _explodeGemFrame3, _explodeGemFrame4
.export _explodeGemFrame5, _explodeGemFrame6
.export _setBuggyDblLoRes
.include "apple2.inc"
@ -909,6 +911,24 @@ xPos: .BYTE $0
square: .BYTE $0
.endproc
.proc _setBuggyDblLoRes
ldx #63
@L1:
lda bgColor,X
sta bgAuxColor,X
dex
bpl @L1
ldx #8
@L2:
lda gemColours,X
sta gemAuxColours,X
dex
bpl @L2
rts
.endproc
.DATA

View File

@ -11,6 +11,7 @@
#include <stdbool.h>
#include <stdint.h>
#include "dbllores.h"
#include "machine.h"
#include "vbl.h"
@ -32,9 +33,9 @@ static tMachineGSSpeed gOldSpeed = GS_SPEED_SLOW;
// Implementation
static bool machineIs2c(void)
static bool machineIs2c(uint8_t machineType)
{
switch (get_ostype()) {
switch (machineType) {
case APPLE_IIC:
case APPLE_IIC35:
case APPLE_IICEXP:
@ -47,9 +48,9 @@ static bool machineIs2c(void)
}
static bool machineIs2GS(void)
static bool machineIs2GS(uint8_t machineType)
{
switch (get_ostype()) {
switch (machineType) {
case APPLE_IIGS:
case APPLE_IIGS1:
case APPLE_IIGS3:
@ -86,18 +87,22 @@ static tMachineGSSpeed setGSSpeed(tMachineGSSpeed newSpeed)
void initMachine(void)
{
if (machineIs2c()) {
uint8_t machineType = get_ostype();
if (machineIs2c(machineType)) {
gVblWait = vblWait2c;
} else if (machineIs2GS()) {
} else if (machineIs2GS(machineType)) {
vblInit2gs();
gOldSpeed = setGSSpeed(GS_SPEED_SLOW);
}
else if (machineType == APPLE_IIECARD)
setBuggyDblLoRes();
}
void uninitMachine(void)
{
if (machineIs2GS()) {
if (machineIs2GS(get_ostype())) {
setGSSpeed(gOldSpeed);
}
}

View File

@ -26,7 +26,7 @@
// Defines
#define SAVE_OPTIONS_FILE "A2BEJWLD.OPTS"
#define VERSION "v2.4"
#define VERSION "v2.5.a1"
#define OPTIONS_VERSION_UNSAVED 0
#define OPTIONS_VERSION 2