move remaining stuff from testcode/lib/ one level up to testcode/
This commit is contained in:
58
testcode/accelerator/Makefile
Normal file
58
testcode/accelerator/Makefile
Normal file
@@ -0,0 +1,58 @@
|
||||
# Just the usual way to find out if we're
|
||||
# using cmd.exe to execute make rules.
|
||||
ifneq ($(shell echo),)
|
||||
CMD_EXE = 1
|
||||
endif
|
||||
|
||||
ifdef CMD_EXE
|
||||
NULLDEV = nul:
|
||||
DEL = -del /f
|
||||
RMDIR = rmdir /s /q
|
||||
else
|
||||
NULLDEV = /dev/null
|
||||
DEL = $(RM)
|
||||
RMDIR = $(RM) -r
|
||||
endif
|
||||
|
||||
ifdef CC65_HOME
|
||||
AS = $(CC65_HOME)/bin/ca65
|
||||
CC = $(CC65_HOME)/bin/cc65
|
||||
CL = $(CC65_HOME)/bin/cl65
|
||||
LD = $(CC65_HOME)/bin/ld65
|
||||
else
|
||||
AS := $(if $(wildcard ../../../bin/ca65*),../../../bin/ca65,ca65)
|
||||
CC := $(if $(wildcard ../../../bin/cc65*),../../../bin/cc65,cc65)
|
||||
CL := $(if $(wildcard ../../../bin/cl65*),../../../bin/cl65,cl65)
|
||||
LD := $(if $(wildcard ../../../bin/ld65*),../../../bin/ld65,ld65)
|
||||
endif
|
||||
|
||||
all: c64-scpu-test.prg c128-scpu-test.prg c64dtv-test.prg \
|
||||
c64-c128-test.prg c128-test.prg chameleon-test.prg \
|
||||
c65-test.prg turbomaster-test.prg
|
||||
|
||||
c64-scpu-test.prg: c64-c128-scpu-test.c
|
||||
$(CL) -t c64 c64-c128-scpu-test.c -o c64-scpu-test.prg
|
||||
|
||||
c128-scpu-test.prg: c64-c128-scpu-test.c
|
||||
$(CL) -t c128 c64-c128-scpu-test.c -o c128-scpu-test.prg
|
||||
|
||||
c64dtv-test.prg: c64dtv-test.c
|
||||
$(CL) -t c64 c64dtv-test.c -o c64dtv-test.prg
|
||||
|
||||
c64-c128-test.prg: c64-c128-test.c
|
||||
$(CL) -t c64 c64-c128-test.c -o c64-c128-test.prg
|
||||
|
||||
c128-test.prg: c64-c128-test.c
|
||||
$(CL) -t c128 c64-c128-test.c -o c128-test.prg
|
||||
|
||||
chameleon-test.prg: chameleon-test.c
|
||||
$(CL) -t c64 chameleon-test.c -o chameleon-test.prg
|
||||
|
||||
c65-test.prg: c65-test.c
|
||||
$(CL) -t c64 c65-test.c -o c65-test.prg
|
||||
|
||||
turbomaster-test.prg: turbomaster-test.c
|
||||
$(CL) -t c64 turbomaster-test.c -o turbomaster-test.prg
|
||||
|
||||
clean:
|
||||
$(RM) *.prg
|
||||
8
testcode/accelerator/c64-c128-scpu-test.c
Normal file
8
testcode/accelerator/c64-c128-scpu-test.c
Normal file
@@ -0,0 +1,8 @@
|
||||
/* C64/C128 SuperCPU accelerator test code. */
|
||||
|
||||
#define ACC_DETECT detect_scpu
|
||||
#define ACC_GET_SPEED get_scpu_speed
|
||||
#define ACC_SET_SPEED set_scpu_speed
|
||||
#define ACC_NAME "SuperCPU"
|
||||
|
||||
#include "turbo-test.c"
|
||||
8
testcode/accelerator/c64-c128-test.c
Normal file
8
testcode/accelerator/c64-c128-test.c
Normal file
@@ -0,0 +1,8 @@
|
||||
/* C128 in C64 mode accelerator test code. */
|
||||
|
||||
#define ACC_DETECT detect_c128
|
||||
#define ACC_GET_SPEED get_c128_speed
|
||||
#define ACC_SET_SPEED set_c128_speed
|
||||
#define ACC_NAME "C128 CPU"
|
||||
|
||||
#include "turbo-test.c"
|
||||
8
testcode/accelerator/c64dtv-test.c
Normal file
8
testcode/accelerator/c64dtv-test.c
Normal file
@@ -0,0 +1,8 @@
|
||||
/* C64DTV accelerator test code. */
|
||||
|
||||
#define ACC_DETECT detect_c64dtv
|
||||
#define ACC_GET_SPEED get_c64dtv_speed
|
||||
#define ACC_SET_SPEED set_c64dtv_speed
|
||||
#define ACC_NAME "C64DTV"
|
||||
|
||||
#include "turbo-test.c"
|
||||
8
testcode/accelerator/c65-test.c
Normal file
8
testcode/accelerator/c65-test.c
Normal file
@@ -0,0 +1,8 @@
|
||||
/* C65/C64DX in C64 mode accelerator test code. */
|
||||
|
||||
#define ACC_DETECT detect_c65
|
||||
#define ACC_GET_SPEED get_c65_speed
|
||||
#define ACC_SET_SPEED set_c65_speed
|
||||
#define ACC_NAME "C65"
|
||||
|
||||
#include "turbo-test.c"
|
||||
8
testcode/accelerator/chameleon-test.c
Normal file
8
testcode/accelerator/chameleon-test.c
Normal file
@@ -0,0 +1,8 @@
|
||||
/* C64 Chameleon accelerator test code. */
|
||||
|
||||
#define ACC_DETECT detect_chameleon
|
||||
#define ACC_GET_SPEED get_chameleon_speed
|
||||
#define ACC_SET_SPEED set_chameleon_speed
|
||||
#define ACC_NAME "Chameleon cartridge"
|
||||
|
||||
#include "turbo-test.c"
|
||||
57
testcode/accelerator/turbo-test.c
Normal file
57
testcode/accelerator/turbo-test.c
Normal file
@@ -0,0 +1,57 @@
|
||||
/* Accelerator test code. */
|
||||
|
||||
#ifndef ACC_DETECT
|
||||
#error This file cannot be used directly (yet)
|
||||
#endif
|
||||
|
||||
#include <time.h>
|
||||
#include <accelerator.h>
|
||||
#include <stdio.h>
|
||||
#include <conio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
static void print_time_taken(void)
|
||||
{
|
||||
clock_t curtime = clock();
|
||||
clock_t newtime;
|
||||
unsigned long i;
|
||||
char buffer[10];
|
||||
|
||||
printf("Doing a speed test, please wait\n");
|
||||
for (i = 0; i < 0x1000; i++) { }
|
||||
newtime = clock() - curtime;
|
||||
ultoa(newtime, buffer, 10);
|
||||
printf("Time taken : %s\n", buffer);
|
||||
}
|
||||
|
||||
static void print_current_speed(void)
|
||||
{
|
||||
unsigned char status;
|
||||
|
||||
status = ACC_GET_SPEED();
|
||||
printf("Current "ACC_NAME" speed : %d\n", status + 1);
|
||||
}
|
||||
|
||||
void main(void)
|
||||
{
|
||||
unsigned char status;
|
||||
unsigned char speed = 0;
|
||||
|
||||
status = ACC_DETECT();
|
||||
clrscr();
|
||||
if (status == 0) {
|
||||
printf("No "ACC_NAME" detected\n");
|
||||
} else {
|
||||
status = ACC_GET_SPEED();
|
||||
print_current_speed();
|
||||
|
||||
/* cycle through all the speeds */
|
||||
for (speed = SPEED_1X; speed <= SPEED_20X; ++speed) {
|
||||
printf("Setting "ACC_NAME" speed to %d\n", speed + 1);
|
||||
ACC_SET_SPEED(speed);
|
||||
print_current_speed();
|
||||
print_time_taken();
|
||||
}
|
||||
ACC_SET_SPEED(status);
|
||||
}
|
||||
}
|
||||
8
testcode/accelerator/turbomaster-test.c
Normal file
8
testcode/accelerator/turbomaster-test.c
Normal file
@@ -0,0 +1,8 @@
|
||||
/* C64 Turbo Master accelerator test code. */
|
||||
|
||||
#define ACC_DETECT detect_turbomaster
|
||||
#define ACC_GET_SPEED get_turbomaster_speed
|
||||
#define ACC_SET_SPEED set_turbomaster_speed
|
||||
#define ACC_NAME "Turbo Master cartridge"
|
||||
|
||||
#include "turbo-test.c"
|
||||
Reference in New Issue
Block a user