mirror of
https://github.com/mlaux/gb6.git
synced 2025-01-21 05:30:12 +00:00
use Standard File functions from System 6, fix compile warnings
This commit is contained in:
parent
a9696e5c7c
commit
f064ee3934
@ -5,6 +5,7 @@
|
||||
emulator.c - entry point */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <Windows.h>
|
||||
#include <Quickdraw.h>
|
||||
#include <StandardFile.h>
|
||||
@ -63,7 +64,7 @@ void StartEmulation(void)
|
||||
z80_run(theState.cpu);
|
||||
}
|
||||
|
||||
bool LoadRom(FSSpec *fp)
|
||||
bool LoadRom(StrFileName fileName, short vRefNum)
|
||||
{
|
||||
int err;
|
||||
short fileNo;
|
||||
@ -75,7 +76,8 @@ bool LoadRom(FSSpec *fp)
|
||||
theState.romLength = 0;
|
||||
}
|
||||
|
||||
err = FSpOpenDF(fp, fsRdWrPerm, &fileNo);
|
||||
|
||||
err = FSOpen(fileName, vRefNum, &fileNo);
|
||||
|
||||
if(err != noErr) {
|
||||
return false;
|
||||
@ -98,13 +100,17 @@ bool LoadRom(FSSpec *fp)
|
||||
|
||||
bool ShowOpenBox(void)
|
||||
{
|
||||
StandardFileReply reply;
|
||||
SFReply reply;
|
||||
Point pt = { 0, 0 };
|
||||
const int stdWidth = 348;
|
||||
Rect rect;
|
||||
|
||||
StandardGetFile(NULL, -1, NULL, &reply);
|
||||
pt.h = qd.screenBits.bounds.right / 2 - stdWidth / 2;
|
||||
|
||||
if(reply.sfGood) {
|
||||
return LoadRom(&reply.sfFile);
|
||||
SFGetFile(pt, NULL, NULL, -1, NULL, NULL, &reply);
|
||||
|
||||
if(reply.good) {
|
||||
return LoadRom(reply.fName, reply.vRefNum);
|
||||
}
|
||||
|
||||
return false;
|
||||
|
Loading…
x
Reference in New Issue
Block a user