git @ Cat's Eye Technologies JaC64 / command-line-arguments
The -a option can autoload from a resource in a JAR. Chris Pressey 4 years ago
1 changed file(s) with 38 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
254254
255255 private boolean readDisk(String name) {
256256 System.out.println("READING FROM: " + name);
257
257258 if ((name.toLowerCase()).endsWith(".d64"))
258259 reader.readDiskFromFile(name);
259260 else if ((name.toLowerCase()).endsWith(".t64"))
280281 return false;
281282 }
282283
284 private boolean readDisk(URL url) {
285 String name = url.toString();
286
287 System.out.println("READING FROM URL: " + name);
288
289 if ((name.toLowerCase()).endsWith(".d64"))
290 reader.readDiskFromURL(url);
291 else if ((name.toLowerCase()).endsWith(".t64"))
292 reader.readTapeFromURL(url);
293 else if (name.toLowerCase().endsWith(".prg") ||
294 name.toLowerCase().endsWith(".p00")) {
295 cpu.reset();
296 try {
297 Thread.sleep(10);
298 }catch (Exception e2) {
299 System.out.println("Exception while sleeping...");
300 }
301 while(!scr.ready()) {
302 try {
303 Thread.sleep(100);
304 }catch (Exception e2) {
305 System.out.println("Exception while sleeping...");
306 }
307 }
308 reader.readPGM(url, -1);
309 cpu.runBasic();
310 return true;
311 }
312 return false;
313 }
314
283315 private void setFull(boolean full) {
284316 // JWindow jw = full ? C64Scr : null;
285317 // java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment().
306338 public void run() {
307339 waitForKernal();
308340 System.out.println("Kernal READY!");
309 readDisk(filename);
341 URL url = getClass().getResource(filename);
342 if (url != null) {
343 readDisk(url);
344 } else {
345 readDisk(filename);
346 }
310347 }
311348 });
312349 t.start();