DEFINT A-Z
DECLARE SUB LoadFILE (FileNAME$)
DIM SHARED Box(32000)
SCREEN 12

BikeCOLOR = 5
ForkCOLOR = 1
FrameCOLOR = 0
FlameSTYLE = 1
GOSUB SetPALETTE
PALETTE 8, 21 + 65536 * 32
PALETTE 11, 32 + 65536 * 42

SHELL "DIR/B/ON *.BSV > Chops.DAT"

OPEN "chops.dat" FOR INPUT AS #1
DO WHILE NOT EOF(1)
LINE INPUT #1, n$
n$ = LTRIM$(RTRIM$(n$))
CLS
LoadFILE n$
SLEEP 1
k$ = INKEY$
IF k$ = CHR$(27) THEN END
LOOP
CLOSE #1

a$ = INPUT$(1)

END '************************** SUBROUTINES BEGIN **************************

SetPALETTE:
RESTORE PaletteDATA
OUT &H3C8, 0
FOR n = 1 TO 18
READ Colr
OUT &H3C9, Colr
NEXT n

RESTORE CustomCOLORS
DIM Colors(5)
FOR n = 0 TO 5
READ Colors(n)
NEXT n

SELECT CASE BikeCOLOR
CASE 0: RESTORE BikeCOLOR0
CASE 1: RESTORE BikeCOLOR1
CASE 2: RESTORE BikeCOLOR2
CASE 3: RESTORE BikeCOLOR3
CASE 4: RESTORE BikeCOLOR4
CASE 5: RESTORE BikeCOLOR5
CASE 6: RESTORE BikeCOLOR6
CASE 7: RESTORE BikeCOLOR7
END SELECT
FOR n = 0 TO 5
OUT &H3C8, Colors(n)
FOR i = 1 TO 3
READ Colr: OUT &H3C9, Colr
NEXT i
NEXT n

IF FlameSTYLE THEN
RESTORE FlameCOLOR
OUT &H3C8, 12
FOR i = 1 TO 3
READ Colr: OUT &H3C9, Colr
NEXT i
OUT &H3C8, 14
FOR i = 1 TO 3
READ Colr: OUT &H3C9, Colr
NEXT i
END IF
OUT &H3C8, 8
OUT &H3C9, 21
OUT &H3C9, 63
OUT &H3C9, 21
OUT &H3C8, 9
OUT &H3C9, 21
OUT &H3C9, 21
OUT &H3C9, 63
OUT &H3C8, 11
OUT &H3C9, 63
OUT &H3C9, 0
OUT &H3C9, 0
RETURN

PaletteDATA:
DATA 0, 0, 12,    6, 4, 14,    12, 12, 20
DATA 31, 31, 38,   46, 46, 50,   0, 0, 0

CustomCOLORS:
DATA 6,7,10,12,13,14

BikeCOLOR0:
DATA  6, 6, 6, 4, 4, 4, 0, 0, 0, 21, 0, 42, 14, 14, 14, 32, 21, 54
BikeCOLOR1:
DATA  5, 12, 0, 3, 9, 0, 0, 6, 0, 32, 42, 32, 6, 18, 6, 51, 63, 52
BikeCOLOR2:
DATA  8, 0, 36, 5, 0, 28, 2, 0, 20, 12, 20, 63, 10, 10, 42, 10, 42, 63
BikeCOLOR3:
DATA  32, 0, 0, 24, 0, 0, 18, 0, 0, 21, 0, 12, 63, 0, 42, 63, 0, 0
BikeCOLOR4:
DATA  63, 0, 0,  54, 0, 0,  42, 0, 0,  32, 0, 0,  63, 20, 43,  42, 0, 21
BikeCOLOR5:
DATA  63, 20, 0, 53, 16, 0, 43, 10, 0, 63, 0, 0, 63, 42, 21, 40, 0, 20
BikeCOLOR6:
DATA  63, 50, 0, 63, 42, 0, 53, 32, 0, 63, 0, 0, 63, 63, 54, 40, 0, 20
BikeCOLOR7:
DATA  58, 58, 63, 48, 48, 58, 38, 38, 48, 31, 31, 51, 63, 63, 63, 42, 42, 63
FlameCOLOR: '12/14
DATA  63, 32, 12, 63, 63, 0
GoldTRIM:
DATA  53, 46, 32, 63, 56, 42

SUB LoadFILE (FileNAME$)

DEF SEG = VARSEG(Box(0))
BLOAD FileNAME$, VARPTR(Box(0))
DEF SEG
x = 320 - (Box(0) / 2)
IF x < 5 THEN x = 0
y = 240 - (Box(1) / 2)
PUT (x, y), Box

END SUB

