mirror of
https://github.com/jeremysrand/apple2048.git
synced 2024-06-08 21:29:30 +00:00
Add special GS page flipping code to work around the lack of text page 2 shadowing
This commit is contained in:
parent
ed97fba75d
commit
f77826ed09
2
Makefile
2
Makefile
|
@ -19,7 +19,7 @@ PLATFORM_CFG=-C apple2-system.cfg
|
||||||
all: $(SYS)
|
all: $(SYS)
|
||||||
|
|
||||||
%.o: %.s
|
%.o: %.s
|
||||||
ca65 -t $(PLATFORM) -o $@ $<
|
ca65 --cpu 65816 -o $@ $<
|
||||||
|
|
||||||
$(SYS): $(ASM_OBJS) $(SRCS)
|
$(SYS): $(ASM_OBJS) $(SRCS)
|
||||||
cl65 -t $(PLATFORM) $(PLATFORM_CFG) --mapfile $(MAPFILE) -o $(SYS) $(SRCS) $(addprefix --obj ,$(ASM_OBJS))
|
cl65 -t $(PLATFORM) $(PLATFORM_CFG) --mapfile $(MAPFILE) -o $(SYS) $(SRCS) $(addprefix --obj ,$(ASM_OBJS))
|
||||||
|
|
23
apple2048.c
23
apple2048.c
|
@ -43,6 +43,8 @@ static tPos gNewTilePos;
|
||||||
|
|
||||||
static bool gPlaySounds = true;
|
static bool gPlaySounds = true;
|
||||||
|
|
||||||
|
static void (*gSwitchToPage2)(void) = switchToPage2;
|
||||||
|
|
||||||
void shortDelay(uint16_t howMuch)
|
void shortDelay(uint16_t howMuch)
|
||||||
{
|
{
|
||||||
while (howMuch > 0) {
|
while (howMuch > 0) {
|
||||||
|
@ -95,9 +97,6 @@ void printInstructions(void)
|
||||||
"AND NO MORE MOVES ARE POSSIBLE. TRY\n"
|
"AND NO MORE MOVES ARE POSSIBLE. TRY\n"
|
||||||
"TO GET THE LARGEST TILE YOU CAN!\n"
|
"TO GET THE LARGEST TILE YOU CAN!\n"
|
||||||
"\n"
|
"\n"
|
||||||
"IF ON A ROM 1 GS, SET ALTERNATE DISPLAY\n"
|
|
||||||
"MODE FROM THE CDA MENU.\n"
|
|
||||||
"\n"
|
|
||||||
"PRESS ESCAPE OR Q TO QUIT AT ANY TIME.\n"
|
"PRESS ESCAPE OR Q TO QUIT AT ANY TIME.\n"
|
||||||
"PRESS R TO START A NEW GAME.\n"
|
"PRESS R TO START A NEW GAME.\n"
|
||||||
"PRESS S TO TOGGLE SOUND.\n"
|
"PRESS S TO TOGGLE SOUND.\n"
|
||||||
|
@ -172,7 +171,7 @@ void printScore(void)
|
||||||
if (highestTile == 0) {
|
if (highestTile == 0) {
|
||||||
printf("TRY TO GET THE %ld TILE!\n", nextTarget());
|
printf("TRY TO GET THE %ld TILE!\n", nextTarget());
|
||||||
} else {
|
} else {
|
||||||
printf("GOT %ld! NOW GET %ld!\n", highestTarget, nextTarget());
|
printf("GOT %ld! NOW GET %ld!\n", highestTile, nextTarget());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -198,7 +197,7 @@ void performAnimationsLeft(void)
|
||||||
do {
|
do {
|
||||||
animInProgress = false;
|
animInProgress = false;
|
||||||
|
|
||||||
switchToPage2();
|
gSwitchToPage2();
|
||||||
for (pos = 0; pos < gNumAnims; pos++) {
|
for (pos = 0; pos < gNumAnims; pos++) {
|
||||||
tileAnim = &(gTileAnims[pos]);
|
tileAnim = &(gTileAnims[pos]);
|
||||||
if (tileAnim->tileString == NULL)
|
if (tileAnim->tileString == NULL)
|
||||||
|
@ -257,7 +256,7 @@ void performAnimationsRight(void)
|
||||||
do {
|
do {
|
||||||
animInProgress = false;
|
animInProgress = false;
|
||||||
|
|
||||||
switchToPage2();
|
gSwitchToPage2();
|
||||||
for (pos = 0; pos < gNumAnims; pos++) {
|
for (pos = 0; pos < gNumAnims; pos++) {
|
||||||
tileAnim = &(gTileAnims[pos]);
|
tileAnim = &(gTileAnims[pos]);
|
||||||
if (tileAnim->tileString == NULL)
|
if (tileAnim->tileString == NULL)
|
||||||
|
@ -314,7 +313,7 @@ void performAnimationsUp(void)
|
||||||
do {
|
do {
|
||||||
animInProgress = false;
|
animInProgress = false;
|
||||||
|
|
||||||
switchToPage2();
|
gSwitchToPage2();
|
||||||
for (pos = 0; pos < gNumAnims; pos++) {
|
for (pos = 0; pos < gNumAnims; pos++) {
|
||||||
tileAnim = &(gTileAnims[pos]);
|
tileAnim = &(gTileAnims[pos]);
|
||||||
if (tileAnim->tileString == NULL)
|
if (tileAnim->tileString == NULL)
|
||||||
|
@ -367,7 +366,7 @@ void performAnimationsDown(void)
|
||||||
do {
|
do {
|
||||||
animInProgress = false;
|
animInProgress = false;
|
||||||
|
|
||||||
switchToPage2();
|
gSwitchToPage2();
|
||||||
for (pos = 0; pos < gNumAnims; pos++) {
|
for (pos = 0; pos < gNumAnims; pos++) {
|
||||||
tileAnim = &(gTileAnims[pos]);
|
tileAnim = &(gTileAnims[pos]);
|
||||||
if (tileAnim->tileString == NULL)
|
if (tileAnim->tileString == NULL)
|
||||||
|
@ -577,6 +576,14 @@ void newTile(tPos at, char *tileString)
|
||||||
|
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
|
switch (get_ostype()) {
|
||||||
|
case APPLE_IIGS:
|
||||||
|
case APPLE_IIGS1:
|
||||||
|
case APPLE_IIGS3:
|
||||||
|
gSwitchToPage2 = gsSwitchToPage2;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
printInstructions();
|
printInstructions();
|
||||||
|
|
||||||
initGameEngine(tileMoved, newTile);
|
initGameEngine(tileMoved, newTile);
|
||||||
|
|
2
game.c
2
game.c
|
@ -297,7 +297,7 @@ tScore highestTarget(void)
|
||||||
|
|
||||||
tScore nextTarget(void)
|
tScore nextTarget(void)
|
||||||
{
|
{
|
||||||
tTileValue value = gScoreRecord.highestTile;
|
tTileValue value = gScoreRecord.highestTile + 1;
|
||||||
|
|
||||||
if (value < 11)
|
if (value < 11)
|
||||||
value = 11;
|
value = 11;
|
||||||
|
|
|
@ -9,3 +9,4 @@
|
||||||
|
|
||||||
void switchToPage2(void);
|
void switchToPage2(void);
|
||||||
void switchToPage1(void);
|
void switchToPage1(void);
|
||||||
|
void gsSwitchToPage2(void);
|
||||||
|
|
85
textpage.s
85
textpage.s
|
@ -6,10 +6,14 @@
|
||||||
; This file contains some assembly routines to more efficiently flip text pages.
|
; This file contains some assembly routines to more efficiently flip text pages.
|
||||||
;
|
;
|
||||||
|
|
||||||
.export _switchToPage2, _switchToPage1
|
.export _switchToPage2, _switchToPage1, _gsSwitchToPage2
|
||||||
|
|
||||||
.include "apple2.inc"
|
.include "apple2.inc"
|
||||||
|
|
||||||
|
.A8
|
||||||
|
.I8
|
||||||
|
.PC02
|
||||||
|
|
||||||
_switchToPage2:
|
_switchToPage2:
|
||||||
ldx #0
|
ldx #0
|
||||||
@L1:
|
@L1:
|
||||||
|
@ -76,3 +80,82 @@ _switchToPage2:
|
||||||
_switchToPage1:
|
_switchToPage1:
|
||||||
stz LOWSCR
|
stz LOWSCR
|
||||||
rts
|
rts
|
||||||
|
|
||||||
|
|
||||||
|
_gsSwitchToPage2:
|
||||||
|
|
||||||
|
.P816
|
||||||
|
clc
|
||||||
|
xce
|
||||||
|
rep #$30
|
||||||
|
|
||||||
|
.A16
|
||||||
|
.I16
|
||||||
|
ldx #0
|
||||||
|
@L3:
|
||||||
|
lda $400,x ; Line 0
|
||||||
|
sta $e00800,x
|
||||||
|
lda $480,x ; Line 1
|
||||||
|
sta $e00880,x
|
||||||
|
lda $500,x ; Line 2
|
||||||
|
sta $e00900,x
|
||||||
|
lda $580,x ; Line 3
|
||||||
|
sta $e00980,x
|
||||||
|
lda $600,x ; Line 4
|
||||||
|
sta $e00a00,x
|
||||||
|
lda $680,x ; Line 5
|
||||||
|
sta $e00a80,x
|
||||||
|
lda $700,x ; Line 6
|
||||||
|
sta $e00b00,x
|
||||||
|
lda $780,x ; Line 7
|
||||||
|
sta $e00b80,x
|
||||||
|
|
||||||
|
lda $428,x ; Line 8
|
||||||
|
sta $e00828,x
|
||||||
|
lda $4a8,x ; Line 9
|
||||||
|
sta $e008a8,x
|
||||||
|
lda $528,x ; Line 10
|
||||||
|
sta $e00928,x
|
||||||
|
lda $5a8,x ; Line 11
|
||||||
|
sta $e009a8,x
|
||||||
|
lda $628,x ; Line 12
|
||||||
|
sta $e00a28,x
|
||||||
|
lda $6a8,x ; Line 13
|
||||||
|
sta $e00aa8,x
|
||||||
|
lda $728,x ; Line 14
|
||||||
|
sta $e00b28,x
|
||||||
|
lda $7a8,x ; Line 15
|
||||||
|
sta $e00ba8,x
|
||||||
|
|
||||||
|
lda $450,x ; Line 16
|
||||||
|
sta $e00850,x
|
||||||
|
lda $4d0,x ; Line 17
|
||||||
|
sta $e008d0,x
|
||||||
|
lda $550,x ; Line 18
|
||||||
|
sta $e00950,x
|
||||||
|
lda $5d0,x ; Line 19
|
||||||
|
sta $e009d0,x
|
||||||
|
lda $650,x ; Line 20
|
||||||
|
sta $e00a50,x
|
||||||
|
lda $6d0,x ; Line 21
|
||||||
|
sta $e00ad0,x
|
||||||
|
lda $750,x ; Line 22
|
||||||
|
sta $e00b50,x
|
||||||
|
lda $7d0,x ; Line 23
|
||||||
|
sta $e00bd0,x
|
||||||
|
|
||||||
|
inx
|
||||||
|
inx
|
||||||
|
cpx #40
|
||||||
|
beq @L4
|
||||||
|
jmp @L3
|
||||||
|
|
||||||
|
@L4:
|
||||||
|
sep #$30
|
||||||
|
.A8
|
||||||
|
.I8
|
||||||
|
sec
|
||||||
|
xce
|
||||||
|
.PC02
|
||||||
|
stz HISCR
|
||||||
|
rts
|
||||||
|
|
Loading…
Reference in New Issue
Block a user