Skip to content

Commit

Permalink
Fix losedos bug
Browse files Browse the repository at this point in the history
  • Loading branch information
uyjulian committed Jan 12, 2015
1 parent bd6f59a commit 44f731a
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ OBJS = $(addprefix $(OBJDIR), emu.o it.o main.o sound.o spc700.o)
COMMONFLAGS =
CFLAGS = $(COMMONFLAGS) -Wall -g
LDFLAGS = $(OBJS) -o $(EXENAME) $(COMMONFLAGS) -lm -g
LD = clang $(LDFLAGS)
CC = clang $(CFLAGS)
LD = gcc $(LDFLAGS)
CC = gcc $(CFLAGS)

.PHONY: clean all

Expand Down
2 changes: 1 addition & 1 deletion emu.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ static s32 LoadZState(char *fn)
{
SPCFile *sFile = malloc(sizeof(SPCFile));
memset(sFile, 0, sizeof(SPCFile));
FILE *f = fopen(fn, "r");
FILE *f = fopen(fn, "rb");
if (f == NULL)
{
printf("Error: can't open file\n");
Expand Down
6 changes: 3 additions & 3 deletions it.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ s32 ITStart() // Opens up temporary file and inits writing
{
SPCAddWriteDSPCallback(&ITWriteDSPCallback);
s32 i;
ittmp = fopen(IT_PATTERN_TEMP_FILE_NAME, "w+");
ittmp = fopen(IT_PATTERN_TEMP_FILE_NAME, "wb+");
if (ittmp == NULL)
return 1;
for (i = 0; i < NUM_PATT_BUFS; i++)
Expand Down Expand Up @@ -224,7 +224,7 @@ s32 ITWrite(char *fn) // Write the final IT file
ITpattlen[ITcurbuf++] = ITbufpos;
ITUpdate(); // Save the changes we just made
// END IT CLEANUP
f = fopen(fn, "w");
f = fopen(fn, "wb");
if (f == NULL)
{
printf("Error: could not open IT file\n");
Expand Down Expand Up @@ -275,7 +275,7 @@ s32 ITWrite(char *fn) // Write the final IT file
free(fHeader);
// orders
for (i = 0; i < curpatt; i++)
fputc(i, f); // Write from 0 to the number of patterns (max: 0xFE)
fputc(i, f); // Write from 0 to the number of patterns (max: 0xFD)
fputc(255, f); // terminating order
// Sample offsets
ofs = sizeof(ITFileHeader) + (curpatt + 1) + ((numsamps * sizeof(s32)) + (curpatt * sizeof(s32)));
Expand Down
1 change: 0 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ Bugs
• The first note isn't being played.
• Pitch slides sound wrong in IT file.
• IT speed is inconsistant.
• Windows isn't creating IT files properly.

More information
================
Expand Down

0 comments on commit 44f731a

Please sign in to comment.