Skip to content

Commit

Permalink
clean ups
Browse files Browse the repository at this point in the history
  • Loading branch information
wiz21b committed Apr 13, 2019
1 parent f5b8f62 commit bad0ec9
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 7 deletions.
Binary file added BAD_APPLE.DSK
Binary file not shown.
Binary file added BAD_APPLE_DATA.DSK
Binary file not shown.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,18 @@ Bad Apple Demo

This demo is the classic Bad Apple demo.

How to run
----------

Open `BAD_DATA.DSK` file in your favourite emulator (I tested Mame and AppleWin).
It will run automatically. When requested to flip the disk, insert `BAD_APPLE_DATA.DSK` in the same drive.
Hit enter, and enjoy !


Background information
----------------------


I decided to do it after watching the demo from Onslaught on C64. It
sounded sad to me that the Apple didn't run the Bad Apple :-)

Expand Down
5 changes: 3 additions & 2 deletions optimize.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,10 @@ def s(p):
d("data.a.best")
d("cstripes.data.best")

for i in range(100):
NB_TRIALS = 200
for i in range(NB_TRIALS):
subprocess.run("python kmean.py")
print("-"*80 + " Run {}".format(i))
print("-"*80 + " Run {}/{}".format(i, NB_TRIALS))
if s("cstripes.data") < (s("cstripes.data.best") or 100000000):
print("Best shot {}".format(s("cstripes.data")))
shutil.copyfile("data.a", "data.a.best")
Expand Down
10 changes: 5 additions & 5 deletions wiz3.a
Original file line number Diff line number Diff line change
Expand Up @@ -248,9 +248,9 @@ buf = $44
*= $C00


+store_8 rs_sectors_to_read, 92
+store_8 target_track, 26
+store_8 target_sector, 12
+store_8 rs_sectors_to_read, 93
+store_8 target_track, 27
+store_8 target_sector, 0
+store_8 target_bank, $40
jsr read_sect

Expand All @@ -264,13 +264,13 @@ buf = $44
LDA LC_RAM_SELECT
LDA LC_RAM_SELECT

SECTORS_PRELOAD = 40
SECTORS_PRELOAD = 35
;; + 1 for the extra bytes which must be outside the buffer !!!
BEGIN_PRELOAD_BUFFER = disk_buffers_base + (2*SECTORS_PER_TRACK-SECTORS_PRELOAD+1)*BYTES_PER_SECTOR

+store_8 rs_sectors_to_read, SECTORS_PRELOAD
+store_8 target_track, 32
+store_8 target_sector, 8
+store_8 target_sector, 13
+store_8 target_bank, >BEGIN_PRELOAD_BUFFER
jsr read_sect

Expand Down

0 comments on commit bad0ec9

Please sign in to comment.