11/8/2023 0 Comments Applewin gamesThat’s why my bug did not happen when running in emulators that set the whole memory to zero during their own initialization! global vars As it is often the case, 0 was the correct initial value. It was indeed a memory location that was not initialized before being used. I then compared the execution flow in a “normal” AppleWin and in the “modified” one, and I quickly converged to the source of the bug.ĭifference between running on a pristine AppleWin and one modified to randomize the memory as on the real machine I modified an AppleWin to fill the memory with random numbers just after after its allocation, which allowed to reproduce my bug. On the contrary, when turning on the real machine, its memory is random. So why did it work on the emulators even without loading a game? Easy: the two emulators set the emulated memory pool to zero just after allocating it. So a memory location was not correctly set before usage, but written with the correct value when loading the game. Indeed, soft resetting the Apple II won’t wipe its memory. That could only lead to one thing: I was reading an uninitialized memory location. More interesting: if I then rebooted the machine and launched a “New Game”, it worked! The monitor can help to debug, but it is limited and crudeĪfter a few attempts, I noticed something interesting: if I launched a “New Game”, the game would inevitably hang. I was in big trouble: if on the Apple II you can break a program at any time using the instruction BRK then inspect the content of the registers and memory location, debugging on it would be a very tedious task. Although it is written in assembly, my game does not rely on any smart trick requiring precision in timings. So if my program hang it and ran perfectly on the emulators it meant two things: my program was buggy and the emulators were not accurate enough to trigger the bug. So what could go wrong with them? Why was the behavior on the emulators inaccurate? The two emulators I ran my program on, AppleWin and Accurapple, are both reliable and can run most, if not all, the Apple II library at ease. Their goal was not only to run the games, but also to document the machine for posterity when no original hardware will remain. In an article published on Arstechnica 10 years ago, the famous byuu, author of the most accurate SNES emulator in existence, stated that, while SNES games could run on a 25MHz PC in the late 90s, a 3GHz modern machine is required to accurately emulate it. Why is that? Because beyond a certain point, increasing accuracy is hard, and costly in CPU. Most emulators seek to be accurate enough to run the entire library of the machine they do not try to be 100% accurate to their model. But from an external point of view, the program runs as it would do on the real stuff. Some less perfect emulators require specific code-path to run some applications that have stricter accuracy requirement than the emulator can provide. If the behavior of an emulator is accurate enough, all the programs will be able to run without any trouble. Those programs reside inside a binary file representing the whole content of there mass storage, a “rom” file, an “iso” image or, in the case of the Apple II, a. Most emulators seek to replicate the behavior of a machine closely enough to run its programs without any noticeable difference. Matteo Trevisan an Applesoft Hobbist Developer.Starting a new game on a real Apple IIe: the level generation hangs during "PLACING ACTORS" What is the purpose of an emulator? To load an Apple II game or program inside apple 1 simulator write CATALOG at the prompt then LOAD and name of With 0300R Then F3, select Integer image inside Apple 1 Folder Then CATALOG and then LOAD HELLO and RUN, return, you go in INTEGER BASIC, otherwise you can load it pressing F3 in the emulator and selecting Integer image inside Apple 1 Folder. I have made a little modification in the code that display the prompt screen like in a real Apple 1. With 0 A9 0 AA 20 EF FF E8 8A 4C 2 0 you run the text monitor remember to write R and press RETURN. To the code and adding a call with 0900R in the prompt. I have add the game from Apple 1 "ROCK PAPER SCISSORS" by makeing a porting for Apple II and adding it With 0700R you can run SHALL WE PLAY A GAME mini game. With 0300R to go to BASIC, with 0500R you can run a Simple Calculator, With 0100R I have built a program that show free variable mem. To exit the first two screens press R return and * return respectively. A porting from Apple 1 ROCK PAPER SCISSORS for Apple //e made by me. This is an Apple 1 for Apple //e Simulator, I have added one program and two games in the Apple 1 OS, one Simple Calculator and SHALL WE PLAY A GAME? made by me. To load it use AppleWin for Windows, Linapple for Linux or Virtual II for Apple Machines. This is a ReactiveMicro wiki page about the Apple II.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |