Successfully rebuild Habitat disk B from source. Added new tool "filldisk" to generat...
authorglake1 <glake1@gmail.com>
Thu, 4 May 2017 20:59:49 +0000 (13:59 -0700)
committerglake1 <glake1@gmail.com>
Thu, 4 May 2017 20:59:49 +0000 (13:59 -0700)
28 files changed:
sources/c64/Actions/make.txt [new file with mode: 0644]
sources/c64/Behaviors/Makefile
sources/c64/Behaviors/avatar_GET_uppercase.m
sources/c64/Behaviors/avatar_PUT_uppercase.m
sources/c64/Behaviors/avatar_get.m
sources/c64/Behaviors/generic_CHANGESTATE_uppercase.m
sources/c64/Behaviors/generic_changeState.m
sources/c64/Behaviors/jukebox_talk.m
sources/c64/Bin/filldisk.exe [new file with mode: 0644]
sources/c64/Images/Heads/equates.m [new file with mode: 0644]
sources/c64/Images/Props/equates.m [new file with mode: 0644]
sources/c64/Makefile
sources/c64/Obj/dataequates.m [new file with mode: 0644]
sources/c64/Obj/datamacros.m [new file with mode: 0644]
sources/c64/Obj/equates.m [new file with mode: 0644]
sources/c64/Obj/farmers_equates.m [new file with mode: 0644]
sources/c64/Obj/macros.m [new file with mode: 0644]
sources/c64/Obj/page4_space.m [new file with mode: 0644]
sources/c64/Obj/ronmacros2.m [new file with mode: 0644]
sources/c64/Obj/zpage.m [new file with mode: 0644]
sources/c64/Sounds/Makefile
sources/c64/Sounds/org_statement [new file with mode: 0644]
sources/c64/Tools/filldisk/d64.h [new file with mode: 0644]
sources/c64/Tools/filldisk/filldisk.c [new file with mode: 0644]
sources/c64/Tools/filldisk/global.h [new file with mode: 0644]
sources/c64/Tools/filldisk/solution/filldisk.sln [new file with mode: 0644]
sources/c64/Tools/filldisk/solution/filldisk.vcxproj [new file with mode: 0644]
sources/c64/loader.obj [new file with mode: 0644]

diff --git a/sources/c64/Actions/make.txt b/sources/c64/Actions/make.txt
new file mode 100644 (file)
index 0000000..9e414c8
--- /dev/null
@@ -0,0 +1 @@
+Run Makefile in ../Behaviors to generate Actions .bin files.\r
index d42631c86a194f5a49796703ff51381ef39d58c8..ff450c6ad5a8adf48b0b58c930f5323eb2b9cc61 100644 (file)
@@ -1,13 +1,15 @@
+.SILENT:
+
 .SUFFIXES: .m .bin
 
 OBJECTS = \
  atm_do.bin atm_get.bin atm_put.bin \
  avatar_do.bin avatar_get.bin avatar_go.bin avatar_put.bin avatar_talk.bin \
   avatar_ATTACK.bin avatar_BASH.bin avatar_CLOSE.bin \
-  avatar_CLOSECONTAINER.bin avatar_DIE.bin avatar_GET.bin \
+  avatar_CLOSECONTAINER.bin avatar_DIE.bin avatar_GET_uppercase.bin \
   avatar_GRABFROM.bin avatar_OPEN.bin avatar_REINCARNATE.bin \
   avatar_OPENCONTAINER.bin avatar_PAID.bin avatar_POSTURE.bin \
-  avatar_PUT.bin avatar_REMOVE.bin avatar_SITORGETUP.bin\
+  avatar_PUT_uppercase.bin avatar_REMOVE.bin avatar_SITORGETUP.bin\
   avatar_THROW.bin avatar_WALK.bin avatar_WEAR.bin \
  book_do.bin \
  bottle_rdo.bin bottle_FILL.bin bottle_POUR.bin\
@@ -66,7 +68,7 @@ OBJECTS = \
   generic_switch.bin generic_throw.bin generic_PAY.bin \
   generic_test.bin \
   generic_enterOrExit.bin \
-  generic_changeState.bin generic_CHANGESTATE.bin\
+  generic_changeState.bin generic_CHANGESTATE_uppercase.bin\
   generic_OFF.bin generic_OFFLIGHT.bin \
   generic_ON.bin generic_ONLIGHT.bin generic_PLAY.bin generic_SPEAK.bin \
   generic_coinOp.bin generic_destroy.bin \
@@ -76,8 +78,13 @@ OBJECTS = \
   trap_go.bin trap_put.bin\
   illegal.bin noEffect.bin unimplemented.bin
 
+actions: $(OBJECTS)
 .m.bin:
-       macross -p $*.m
-       loadrom -q -p 0 -t < m.out > $*.bin
+       echo making $*.bin
+       macross -c -p -o $*.obj $*.m
+       mtobin $*.obj $*.bin
+       cp -f $*.bin ../Actions/$*.bin
+
+clean:
+       rm *.obj *.bin
 
-actions: $(OBJECTS)
index cfb033eeeea7117685902370c88825beb620da4e..fc60d54112bc9af986130495033f5f779242c07c 100644 (file)
@@ -41,4 +41,4 @@ define GET_HOW = 1
        pla                             ; Chore selected above
        chainTo v_set_actor_chore
 
-       actionEnd
\ No newline at end of file
+       actionEnd
index 8f528b4f013ff2389694fe514e2dcf5930ee9207..81a3a118cd5e3904f74bdd5892ba6c15718ea720 100644 (file)
@@ -54,4 +54,4 @@ define SAVE_Y = async_workspace
        pla                             ; Chore selected above
        chainTo v_set_actor_chore
 
-       actionEnd
\ No newline at end of file
+       actionEnd
index 011b42ce04b642aa11d47cd972495b845ed5dc71..3f1f47d871b8f2768da51bdcaaae89ae63755b16 100644 (file)
@@ -93,4 +93,4 @@ skip:
        jsr     v_beep_or_boing
        lda     #AV_ACT_stand
        chainto v_set_actor_chore
-       actionEnd
+       actionEnd
\ No newline at end of file
index b676da32d0da16d034797b00978e8844403ed8c9..a03d8e21443b48e755b226a12c3896bba35d6b22 100644 (file)
@@ -20,4 +20,4 @@ define NEW_STATE = 0
        newImage actor_noid
        rts
 
-       actionEnd
\ No newline at end of file
+       actionEnd
index a51e2623061d492ec61ce2ea28644a79e2b9797b..6a82d0bb2b1e944b027ed1493a5b01e731dd2fb7 100644 (file)
@@ -21,4 +21,3 @@ define        NEW_STATE       =       0
        rts
 
        actionEnd
-
index 2b3186aaf6a59797f3691726f12c2fe9762c5d37..e966bb3b95e5f4afe29fa1ea1f292637aa5e518e 100644 (file)
@@ -26,7 +26,24 @@ define SELECT_SUCCESS = 0
                ldx     pointed_noid            ; Sent to the jukebox
                jsr     v_send_string           ; Send the request...
                jsr     v_balloonMessage        ; ...and echo it locally
-               waitFor reply_wait_bit          ; Wait for response
+
+               ;waitFor reply_wait_bit         ; Wait for response
+
+               lda     switcher                ; appears to be debug code
+               cmp     reply_wait_bit
+               beq     jukebox_next
+               lda     0xd020
+               pha
+               lda     reply_wait_bit
+               sta     0xd020
+jukebox_wait:
+               lda     switcher
+               cmp     reply_wait_bit
+               bne     jukebox_wait
+               pla
+               sta     0xd020
+
+jukebox_next:
                jsr     v_clear_text_line
                getResponse SELECT_SUCCESS
                if (!zero) {                    ; If it worked...
diff --git a/sources/c64/Bin/filldisk.exe b/sources/c64/Bin/filldisk.exe
new file mode 100644 (file)
index 0000000..165d819
Binary files /dev/null and b/sources/c64/Bin/filldisk.exe differ
diff --git a/sources/c64/Images/Heads/equates.m b/sources/c64/Images/Heads/equates.m
new file mode 100644 (file)
index 0000000..76526d8
--- /dev/null
@@ -0,0 +1,228 @@
+;---------------------------------
+;
+;      defines and equates
+;
+
+       define  swap_pat        = cartoon_buffer+12
+
+       define  rtstick         = 0b00001000    ; joystick bit masks
+       define  ltstick         = 0b00000100
+       define  dnstick         = 0b00000010
+       define  upstick         = 0b00000001
+
+       define  run             = 0x00  ; used in run_length decoding in paint
+
+       define  type_sky        = 0
+       define  type_wall       = 1
+       define  type_grnd       = 2
+       define  type_nogo       = 3
+
+       define  bg      = 0x00                  ; background object
+       define  fg      = 0x80                  ; foreground object
+
+       define  color_black     = 0x00
+       define  color_white     = 0x01
+       define  color_red       = 0x02
+       define  color_cyan      = 0x03
+       define  color_purple    = 0x04
+       define  color_green     = 0x05
+       define  color_blue      = 0x06
+       define  color_yellow    = 0x07
+       define  color_peach     = 0x08
+       define  color_brown     = 0x09
+       define  color_pink      = 0x0a
+       define  color_gray1     = 0x0b
+       define  color_gray2     = 0x0c
+       define  color_lgreen    = 0x0d
+       define  color_sky       = 0x0e
+       define  color_gray3     = 0x0f
+
+       define  pat_glass       = 0q0000        ; bitmap patterns
+       define  pat_sky         = 0q0000        ; bitmap patterns
+       define  pat_wild        = 0q1111
+       define  pat_black       = 0q2222
+       define  pat_pink        = 0q3333
+
+       define  AVATAR_LEG_LIMB         =       0
+       define  AVATAR_TORSO_LIMB       =       1
+       define  AVATAR_ARM_LIMB         =       2
+       define  AVATAR_FACE_LIMB        =       3
+
+
+
+;****************************************
+;      CHARACTERS USED IN SIGNS!
+;****************************************
+
+       define  char_space                      = 0x20
+       define  char_delete                     = 0x7c
+
+
+       define  shift_0                         = 128 + 0
+       define  shift_plus                      = 128 + 1
+       define  shift_minus                     = 128 + 2
+       define  shift_asterisk                  = 128 + 3
+       define  shift_at                        = 128 + 4
+       define  shift_equal                     = 128 + 5
+       define  sign_char_return_key            = 128 + 6
+       define  cursor_right                    = 128 + 7
+       define  cursor_left                     = 128 + 8
+       define  cursor_up                       = 128 + 9
+       define  cursor_down                     = 128 + 10
+       define  home_key                        = 128 + 11
+       define  clear_key                       = 128 + 12
+       define  british_pound                   = 128 + 13
+       define  insert_key                      = 128 + 14
+       define  shift_british_pound             = 128 + 15
+
+
+       define  start_text                      = insert_key
+       define  sign_char_half_space            = shift_0
+       define  sign_char_double_space          = shift_british_pound
+       define  sign_char_inc_width             = shift_plus
+       define  sign_char_dec_width             = shift_minus
+       define  sign_char_inc_height            = shift_asterisk
+       define  sign_char_dec_height            = shift_at
+       define  sign_char_half_size             = shift_equal
+       define  sign_char_half_char_down        = home_key
+       define  sign_char_inverse_video         = clear_key
+       define  sign_char_cursor_right          = cursor_right
+       define  sign_char_cursor_left           = cursor_left
+       define  sign_char_cursor_up             = cursor_up
+       define  sign_char_cursor_down           = cursor_down
+
+
+;      Graphic data in the form of...
+;
+;      How Held + # of states                          1 byte
+;      Which cels change color_ram                     1 byte
+;      Offset to graphic state tables                  1 byte
+;      Container?  if yes, offset for x/y tables       1 byte
+       define  image_walk_offset                       = 4     ; 3 bytes
+;                                                      -------
+       define  Header_total                            = 7
+
+
+
+       define  left            = 0x00          ; walkto object facing!
+       define  right           = 0x01
+       define  up              = 0x02
+       define  down            = 0x03
+
+
+
+;      FIRST BYTE IN CEL
+       define  cel_cel         = 0b00000000
+       define  cel_trap        = 0b01000000
+       define  cel_box         = 0b10000000
+       define  cel_circle      = 0b11000000
+       define  cel_mask        = 0b11000000
+       define  cel_text        = 0b00100000
+       define  cel_wid_mask    = 0b00001111
+
+       define  lr_bord         = 0b00100000    ; borders on boxes
+       define  tb_bord         = 0b00010000
+       define  both_bord       = 0b00110000
+
+       define  col             = 0b00000000    ; get color or pattern
+       define  pat             = 0b00010000
+
+
+;      FIRST BYTE OF GRAPHIC DESCRIPTER
+       define  swing           = 0b00000000    ; how objects are held
+       define  out             = 0b01000000    ; 2nd two bits
+       define  both            = 0b10000000
+       define  at_side         = 0b11000000
+       define  hold_mask       = 0b11000000
+
+       define  state_mask      = 0b00111111    ; # of graphic states (0-63)
+
+;;     define  swing           = 0b00000000    ; how objects are held
+;;     define  out             = 0b00100000    ; 2nd two bits
+;;     define  both            = 0b01000000
+;;     define  at_side         = 0b01100000
+;;     define  hold_mask       = 0b01100000
+;;
+;;     define  state_mask      = 0b00011111    ; # of graphic states (0-31)
+
+
+;      ANIMATION DATA
+       define  no_animation    = 0b00000000
+       define  cycle           = 0b10000000    ; high bit cycle animation
+       define  cycle_mask      = 0b10000000
+
+       define  no_cont         = 0b00000000
+
+;      ORIENTATION BYTE
+       define  st_colr         = 0b10000000            ; whether trap stores
+       define  no_colr         = 0b00000000            ; into color_map
+       define  color_mask      = 0b11111000            ; if color, and color
+
+
+       define  orient_right    = 0b00000000
+       define  orient_left     = 0b00000001
+;;     define  orient_forward  = 0b00000010
+;;     define  orient_back     = 0b00000011
+       define  cel_dx_mask     = 0b00000001
+;;     define  face_left_bit   = 0b00000100
+
+
+;      AVATARS use of OBJECT_animation_state
+
+       define  invisible_bit   = 0b10000000
+       define  moonwalk_bit    = 0b00000001
+       define  avatar_on_hold  = 0b01000000    ; don't draw for now
+                                               ; DIFFERENT from invis.
+;      OBJECT_animation_start
+;      define  new_head_facing = 0b10000000
+;      define  head_gr_state   = 0b00000011
+
+;      OBJECT_animation_end
+       define  walk_end_chore  = 0b00000011
+       define  on_my_way       = 0b00001000    ; 0 if at_destination
+       define  walk_this_way   = 0b10000000
+
+
+
+;      define  AV_ACT_init             = 0x80  + 0
+       define  AV_ACT_stand            = 0x80  + 1
+       define  AV_ACT_walk             = 0x80  + 2
+       define  AV_ACT_hand_back        = 0x80  + 3
+       define  AV_ACT_sit_floor        = 0x80  + 4
+       define  AV_ACT_sit_chair        = 0x80  + 5
+       define  AV_ACT_bend_over        = 0x80  + 6
+       define  AV_ACT_bend_back        = 0x80  + 7
+       define  AV_ACT_point            = 0x80  + 8
+       define  AV_ACT_throw            = 0x80  + 9
+       define  AV_ACT_get_shot         = 0x80  + 10
+       define  AV_ACT_jump             = 0x80  + 11
+       define  AV_ACT_punch            = 0x80  + 12
+       define  AV_ACT_wave             = 0x80  + 13
+       define  AV_ACT_frown            = 0x80  + 14
+       define  AV_ACT_stand_back       = 0x80  + 15
+       define  AV_ACT_walk_front       = 0x80  + 16
+       define  AV_ACT_walk_back        = 0x80  + 17
+       define  AV_ACT_stand_front      = 0x80  + 18
+       define  AV_ACT_unpocket         = 0x80  + 19
+       define  AV_ACT_gimme            = 0x80  + 20
+       define  AV_ACT_knife            = 0x80  + 21
+       define  AV_ACT_arm_get          = 0x80  + 22
+       define  AV_ACT_hand_out         = 0x80  + 23
+       define  AV_ACT_operate          = 0x80  + 24
+       define  AV_ACT_arm_back         = 0x80  + 25
+       define  AV_ACT_shoot1           = 0x80  + 26
+       define  AV_ACT_shoot2           = 0x80  + 27
+       define  AV_ACT_nop              = 0x80  + 28
+       define  AV_ACT_sit_front        = 0x80  + 29
+
+
+       define  AV_ACT_help_key         = 0x80  + 122
+
+       define  AV_ACT_stand_left       = 0x80  + 123
+       define  AV_ACT_stand_right      = 0x80  + 124
+
+       define  AV_ACT_change_color     = 0x80  + 125
+       define  AV_ACT_face_left        = 0x80  + 126
+       define  AV_ACT_face_right       = 0x80  + 127
+
+
diff --git a/sources/c64/Images/Props/equates.m b/sources/c64/Images/Props/equates.m
new file mode 100644 (file)
index 0000000..76526d8
--- /dev/null
@@ -0,0 +1,228 @@
+;---------------------------------
+;
+;      defines and equates
+;
+
+       define  swap_pat        = cartoon_buffer+12
+
+       define  rtstick         = 0b00001000    ; joystick bit masks
+       define  ltstick         = 0b00000100
+       define  dnstick         = 0b00000010
+       define  upstick         = 0b00000001
+
+       define  run             = 0x00  ; used in run_length decoding in paint
+
+       define  type_sky        = 0
+       define  type_wall       = 1
+       define  type_grnd       = 2
+       define  type_nogo       = 3
+
+       define  bg      = 0x00                  ; background object
+       define  fg      = 0x80                  ; foreground object
+
+       define  color_black     = 0x00
+       define  color_white     = 0x01
+       define  color_red       = 0x02
+       define  color_cyan      = 0x03
+       define  color_purple    = 0x04
+       define  color_green     = 0x05
+       define  color_blue      = 0x06
+       define  color_yellow    = 0x07
+       define  color_peach     = 0x08
+       define  color_brown     = 0x09
+       define  color_pink      = 0x0a
+       define  color_gray1     = 0x0b
+       define  color_gray2     = 0x0c
+       define  color_lgreen    = 0x0d
+       define  color_sky       = 0x0e
+       define  color_gray3     = 0x0f
+
+       define  pat_glass       = 0q0000        ; bitmap patterns
+       define  pat_sky         = 0q0000        ; bitmap patterns
+       define  pat_wild        = 0q1111
+       define  pat_black       = 0q2222
+       define  pat_pink        = 0q3333
+
+       define  AVATAR_LEG_LIMB         =       0
+       define  AVATAR_TORSO_LIMB       =       1
+       define  AVATAR_ARM_LIMB         =       2
+       define  AVATAR_FACE_LIMB        =       3
+
+
+
+;****************************************
+;      CHARACTERS USED IN SIGNS!
+;****************************************
+
+       define  char_space                      = 0x20
+       define  char_delete                     = 0x7c
+
+
+       define  shift_0                         = 128 + 0
+       define  shift_plus                      = 128 + 1
+       define  shift_minus                     = 128 + 2
+       define  shift_asterisk                  = 128 + 3
+       define  shift_at                        = 128 + 4
+       define  shift_equal                     = 128 + 5
+       define  sign_char_return_key            = 128 + 6
+       define  cursor_right                    = 128 + 7
+       define  cursor_left                     = 128 + 8
+       define  cursor_up                       = 128 + 9
+       define  cursor_down                     = 128 + 10
+       define  home_key                        = 128 + 11
+       define  clear_key                       = 128 + 12
+       define  british_pound                   = 128 + 13
+       define  insert_key                      = 128 + 14
+       define  shift_british_pound             = 128 + 15
+
+
+       define  start_text                      = insert_key
+       define  sign_char_half_space            = shift_0
+       define  sign_char_double_space          = shift_british_pound
+       define  sign_char_inc_width             = shift_plus
+       define  sign_char_dec_width             = shift_minus
+       define  sign_char_inc_height            = shift_asterisk
+       define  sign_char_dec_height            = shift_at
+       define  sign_char_half_size             = shift_equal
+       define  sign_char_half_char_down        = home_key
+       define  sign_char_inverse_video         = clear_key
+       define  sign_char_cursor_right          = cursor_right
+       define  sign_char_cursor_left           = cursor_left
+       define  sign_char_cursor_up             = cursor_up
+       define  sign_char_cursor_down           = cursor_down
+
+
+;      Graphic data in the form of...
+;
+;      How Held + # of states                          1 byte
+;      Which cels change color_ram                     1 byte
+;      Offset to graphic state tables                  1 byte
+;      Container?  if yes, offset for x/y tables       1 byte
+       define  image_walk_offset                       = 4     ; 3 bytes
+;                                                      -------
+       define  Header_total                            = 7
+
+
+
+       define  left            = 0x00          ; walkto object facing!
+       define  right           = 0x01
+       define  up              = 0x02
+       define  down            = 0x03
+
+
+
+;      FIRST BYTE IN CEL
+       define  cel_cel         = 0b00000000
+       define  cel_trap        = 0b01000000
+       define  cel_box         = 0b10000000
+       define  cel_circle      = 0b11000000
+       define  cel_mask        = 0b11000000
+       define  cel_text        = 0b00100000
+       define  cel_wid_mask    = 0b00001111
+
+       define  lr_bord         = 0b00100000    ; borders on boxes
+       define  tb_bord         = 0b00010000
+       define  both_bord       = 0b00110000
+
+       define  col             = 0b00000000    ; get color or pattern
+       define  pat             = 0b00010000
+
+
+;      FIRST BYTE OF GRAPHIC DESCRIPTER
+       define  swing           = 0b00000000    ; how objects are held
+       define  out             = 0b01000000    ; 2nd two bits
+       define  both            = 0b10000000
+       define  at_side         = 0b11000000
+       define  hold_mask       = 0b11000000
+
+       define  state_mask      = 0b00111111    ; # of graphic states (0-63)
+
+;;     define  swing           = 0b00000000    ; how objects are held
+;;     define  out             = 0b00100000    ; 2nd two bits
+;;     define  both            = 0b01000000
+;;     define  at_side         = 0b01100000
+;;     define  hold_mask       = 0b01100000
+;;
+;;     define  state_mask      = 0b00011111    ; # of graphic states (0-31)
+
+
+;      ANIMATION DATA
+       define  no_animation    = 0b00000000
+       define  cycle           = 0b10000000    ; high bit cycle animation
+       define  cycle_mask      = 0b10000000
+
+       define  no_cont         = 0b00000000
+
+;      ORIENTATION BYTE
+       define  st_colr         = 0b10000000            ; whether trap stores
+       define  no_colr         = 0b00000000            ; into color_map
+       define  color_mask      = 0b11111000            ; if color, and color
+
+
+       define  orient_right    = 0b00000000
+       define  orient_left     = 0b00000001
+;;     define  orient_forward  = 0b00000010
+;;     define  orient_back     = 0b00000011
+       define  cel_dx_mask     = 0b00000001
+;;     define  face_left_bit   = 0b00000100
+
+
+;      AVATARS use of OBJECT_animation_state
+
+       define  invisible_bit   = 0b10000000
+       define  moonwalk_bit    = 0b00000001
+       define  avatar_on_hold  = 0b01000000    ; don't draw for now
+                                               ; DIFFERENT from invis.
+;      OBJECT_animation_start
+;      define  new_head_facing = 0b10000000
+;      define  head_gr_state   = 0b00000011
+
+;      OBJECT_animation_end
+       define  walk_end_chore  = 0b00000011
+       define  on_my_way       = 0b00001000    ; 0 if at_destination
+       define  walk_this_way   = 0b10000000
+
+
+
+;      define  AV_ACT_init             = 0x80  + 0
+       define  AV_ACT_stand            = 0x80  + 1
+       define  AV_ACT_walk             = 0x80  + 2
+       define  AV_ACT_hand_back        = 0x80  + 3
+       define  AV_ACT_sit_floor        = 0x80  + 4
+       define  AV_ACT_sit_chair        = 0x80  + 5
+       define  AV_ACT_bend_over        = 0x80  + 6
+       define  AV_ACT_bend_back        = 0x80  + 7
+       define  AV_ACT_point            = 0x80  + 8
+       define  AV_ACT_throw            = 0x80  + 9
+       define  AV_ACT_get_shot         = 0x80  + 10
+       define  AV_ACT_jump             = 0x80  + 11
+       define  AV_ACT_punch            = 0x80  + 12
+       define  AV_ACT_wave             = 0x80  + 13
+       define  AV_ACT_frown            = 0x80  + 14
+       define  AV_ACT_stand_back       = 0x80  + 15
+       define  AV_ACT_walk_front       = 0x80  + 16
+       define  AV_ACT_walk_back        = 0x80  + 17
+       define  AV_ACT_stand_front      = 0x80  + 18
+       define  AV_ACT_unpocket         = 0x80  + 19
+       define  AV_ACT_gimme            = 0x80  + 20
+       define  AV_ACT_knife            = 0x80  + 21
+       define  AV_ACT_arm_get          = 0x80  + 22
+       define  AV_ACT_hand_out         = 0x80  + 23
+       define  AV_ACT_operate          = 0x80  + 24
+       define  AV_ACT_arm_back         = 0x80  + 25
+       define  AV_ACT_shoot1           = 0x80  + 26
+       define  AV_ACT_shoot2           = 0x80  + 27
+       define  AV_ACT_nop              = 0x80  + 28
+       define  AV_ACT_sit_front        = 0x80  + 29
+
+
+       define  AV_ACT_help_key         = 0x80  + 122
+
+       define  AV_ACT_stand_left       = 0x80  + 123
+       define  AV_ACT_stand_right      = 0x80  + 124
+
+       define  AV_ACT_change_color     = 0x80  + 125
+       define  AV_ACT_face_left        = 0x80  + 126
+       define  AV_ACT_face_right       = 0x80  + 127
+
+
index 6283eece3a412582f2dd01e4322f21018866dbe5..43c644012da9c1ff7fe9b6fdb656b7b7dc48f15b 100644 (file)
@@ -1,12 +1,28 @@
+.SILENT:
+
+disk: jmuddle charset data
+
+jmuddle:
+       echo jmuddle: beta.mud
+       -jmuddle < beta.mud > beta.jlist
 
 muddle:
-       /u0/chip/habitat/muddle/muddle < beta.mud > beta.list
-       getpic 0 7800 <image.dat >image1.dat
-       getpic 7800 7800 <image.dat >image2.dat
-       getpic 0 7800 <head.dat >head1.dat
-       getpic 7800 6500 <head.dat >head2.dat
+       echo muddle: beta.mud
+       -muddle < beta.mud > beta.list
 
 charset:
-       macross -p on_disk_charset.m
-       loadrom -q -p 0 -t < m.out > on_disk_charset.dat
-       
+       echo making on_disk_charset.bin
+       macross -c -p -o on_disk_charset.obj on_disk_charset.m
+       mtobin on_disk_charset.obj on_disk_charset.dat
+
+data:
+       dd if=image.dat of=image1.dat bs=30720 count=1        # block size 30720 == 0x7800
+       dd if=image.dat of=image2.dat bs=30720 count=1 skip=1 # add conv=sync if padding with zeros needed
+       dd if=head.dat of=head1.dat bs=30720 count=1
+       dd if=head.dat of=head2.dat bs=30720 count=1 skip=1
+       filldisk class_equates.m Habitat-B.d64
+
+#      getpic 0 7800 <image.dat >image1.dat
+#      getpic 7800 7800 <image.dat >image2.dat
+#      getpic 0 7800 <head.dat >head1.dat
+#      getpic 7800 6500 <head.dat >head2.dat
diff --git a/sources/c64/Obj/dataequates.m b/sources/c64/Obj/dataequates.m
new file mode 100644 (file)
index 0000000..900b1a9
--- /dev/null
@@ -0,0 +1,252 @@
+
+define end_of_standard_init    =       6       ; ''  ''    ''       ''
+define object_init_offset      =       6       ; ''  ''    ''       ''
+define AVATAR_HAND             =       5
+define AVATAR_HEAD             =       6
+define AVATAR_LAST             =       6
+
+define OPAQUE                  =       0x80
+
+; ----------------------------------------------------------------------
+; Equates
+; ----------------------------------------------------------------------
+               org     0
+type_object:   block   1
+type_class:    block   1
+type_image:    block   1
+type_action:   block   1
+type_sound:    block   1
+
+               org     0
+size_offset:           block   2
+link_offset:
+BLOCK_type:            block   1
+BLOCK_number:          block   1
+BLOCK_lrc:             block   1
+BLOCK_data_offset:     block   0
+
+               org 0
+OBJECT_object_length:  block   2                       ; common to all objcts
+OBJECT_block_info:     block   2
+OBJECT_wait_state:                     ; double duty high 4 bits wait
+OBJECT_resources:      block   1       ; low four bits -resource status-
+OBJECT_class_pointer:  block   1
+OBJECT_style_pointer:  block   1
+OBJECT_x_position:     block   1
+OBJECT_container_offset:                       ; contained objects have no y
+OBJECT_y_position:     block   1
+OBJECT_orientation:    block   1
+OBJECT_animation_state:        block   1               ; host sends as an init byte
+OBJECT_contained_by:   block   1
+
+OBJECT_animation_frame:        block   1
+OBJECT_animation_start:        block   1
+OBJECT_animation_end:  block   1
+
+OBJECT_text_start:     block   0
+OBJECT_contents:       block   0
+generic_object_end:
+
+AVATAR_contents:               block   7
+AVATAR_background_activity:    block   1
+AVATAR_action:                 block   1
+AVATAR_health:                 block   1
+AVATAR_restrainer:             block   1
+AVATAR_customize:              block   2
+AVATAR_destination_x:          block   1
+AVATAR_destination_y:          block   1
+
+AVATAR_cel_state:              block   6
+AVATAR_cel_state_start:                block   6
+AVATAR_cel_state_end:          block   6
+
+
+;;AVATAR_xlo:                  block   1
+;;AVATAR_ylo:                  block   1
+;;AVATAR_cel_frame_number:     block   6
+;;AVATAR_cel_1_state_table:    block   16
+;;AVATAR_cel_2_state_table:    block   16
+;;AVATAR_cel_3_state_table:    block   16
+;;AVATAR_cel_4_state_table:    block   16
+;;AVATAR_cel_5_state_table:    block   16
+;;AVATAR_cel_6_state_table:    block   16
+
+AVATAR_limb_activity:          block   6
+define PATTERN_TORSO = 0
+define TORSO_MASK = 0x0F
+define PATTERN_LEGS = 0
+define LEGS_MASK = 0xF0
+define PATTERN_ARMS = 1
+define ARMS_MASK = 0xF0
+define PATTERN_HAIR = 1
+define HAIR_MASK = 0x0F
+define SEX_BIT = 0x80
+
+               org generic_object_end
+HEAD_init_state:               block   1
+
+               org generic_object_end
+GENERIC_state:                 block   1
+
+               org generic_object_end
+GENERIC_on:                    block   1
+
+               org generic_object_end
+GENERIC_isMagic:               block   1
+
+               org generic_object_end
+GENERIC_mass:                  block   1
+
+               org generic_object_end
+TRAP_type:                     block   1
+TRAP_parameters:               block   5
+;  for super traps
+TRAP_pattern_x_size:           block   1
+TRAP_pattern_y_size:           block   1
+TRAP_pattern_stuff:            block   32
+
+               org generic_object_end
+AQUARIUM_state:                        block   1
+
+               org generic_object_end
+BOOK_pageNumber:               block   1
+
+               org generic_object_end
+BOTTLE_filled:                 block   1
+
+               org generic_object_end
+DIE_state:                     block   1
+
+               org generic_object_end
+DOOR_flags:                    block   1
+DOOR_key_hi:                   block   1
+DOOR_key_lo:                   block   1
+
+               org generic_object_end
+DRUGS_count:                   block   1
+
+               org generic_object_end
+ESCAPE_DEVICE_charge:          block   1
+
+               org generic_object_end
+FAKE_GUN_state:                        block   1
+FAKE_GUN_safetyOn:             block   1
+
+               org generic_object_end
+FLAG_state:                    block   1
+
+               org generic_object_end
+FLASHLIGHT_on:                 block   1
+
+               org generic_object_end
+FLOOR_LAMP_on:                 block   1
+
+               org generic_object_end
+GEMSTONE_isMagic:              block   1
+
+               org generic_object_end
+GRENADE_pinPulled:             block   1
+
+               org generic_object_end
+GUN_safetyOn:                  block   1
+
+               org generic_object_end
+HAND_OF_GOD_state:             block   1
+
+               org generic_object_end
+JUKEBOX_playsToGo:             block   1
+
+               org generic_object_end
+KEY_key_number_hi:             block   1
+KEY_key_number_lo:             block   1
+
+               org generic_object_end
+MAGIC_LAMP_state:              block   1
+MAGIC_LAMP_wisher:             block   1
+
+               org generic_object_end
+MAILBOX_mailArrived:           block   1
+
+               org generic_object_end
+MOVIE_CAMERA_on:               block   1
+
+               org generic_object_end
+PARKING_METER_state:           block   1
+
+               org generic_object_end
+STEREO_tape:                   block   1
+
+
+               org generic_object_end
+TELEPORT_state:                        block   1
+
+               org generic_object_end
+TOKENS_denomination:           block   2
+
+               org generic_object_end
+TOP_torsoPattern:              block   1
+TOP_armPattern:                        block   1
+
+               org generic_object_end
+BOTTOM_legPattern:             block   1
+
+               org generic_object_end
+VENDO_FRONT_contents:          block  10
+VENDO_FRONT_junk:              block   3
+VENDO_FRONT_price:             block   1
+VENDO_FRONT_displaySlot:       block   1
+
+               org generic_object_end
+VENDO_INSIDE_vendoFront:       block   1
+VENDO_INSIDE_productOnDisplay: block   1
+VENDO_INSIDE_junk:             block   3
+
+               org generic_object_end
+WINDUP_TOY_windLevel:          block   1
+
+               org generic_object_end
+ZONE_name:                     block   10
+ZONE_west:                     block   1               ; object # of neighbor
+ZONE_north:                    block   1
+ZONE_east:                     block   1
+ZONE_south:                    block   1
+ZONE_orientation:              block   1               ; west/north/etc.
+ZONE_style:                    block   1
+ZONE_light_level:              block   1               ; init at ???
+ZONE_horizon:                  block   1               ; init at 32?
+ZONE_ClassGroup:               block   1
+
+
+
+
+; These are the instance variables that follow the contents vector in all
+;  container objects
+               org 0
+CONTAINER_flags:       block   1
+CONTAINER_key_hi:      block   1
+CONTAINER_key_lo:      block   1
+
+               org 0
+CLASS_class_length:    block   2
+CLASS_block_info:      block   3
+CLASS_image_count:     block   1
+CLASS_sound_count:     block   1
+CLASS_action_count:    block   1
+CLASS_image_offset:    block   1
+CLASS_sound_offset:    block   1
+CLASS_action_offset:   block   1
+CLASS_object_length:   block   1
+CLASS_init_count:                              ; low 6 bits
+CLASS_flags:           block   1               ; high 2 (only one used now)
+CLASS_capacity:                block   1
+CLASS_start_images:    block   0
+;CLASS_max_occupancy:  block   1
+; ----------------------------------------------------------------------
+define class_file  = 0x0100
+define action_file = 0x0200
+define sound_file  = 0x0600
+define image_file  = 0x0700
+define head_file   = 0x1600
+define id_file    = 0x1200             ; is this a data disk?
+define loader_file = id_file+1
+define charset_file = 0x1208
diff --git a/sources/c64/Obj/datamacros.m b/sources/c64/Obj/datamacros.m
new file mode 100644 (file)
index 0000000..0a42e25
--- /dev/null
@@ -0,0 +1,215 @@
+; ----------------------------------------------------------------------
+; Get Address indirect macros
+; ----------------------------------------------------------------------
+macro getclassaddr pointer,addr {
+    
+       ldy pointer
+       lda y[Class_table_lo]
+       sta addr
+       lda y[Class_table_hi]
+       sta addr+1
+}    
+
+macro getsoundaddr pointer,addr {
+    
+       ldy pointer
+       lda y[Sound_table_lo]
+       sta addr
+       lda y[Sound_table_hi]
+       sta addr+1
+}    
+
+macro getimageaddr pointer,addr {
+    
+       ldy pointer
+       lda y[Image_table_lo]
+       sta addr
+       lda y[Image_table_hi]
+       sta addr+1
+}    
+
+macro getactionaddr pointer,addr {
+    
+       ldy pointer
+       lda y[Action_table_lo]
+       sta addr
+       lda y[Action_table_hi]
+       sta addr+1
+}    
+
+macro getobjectaddr pointer,addr {
+    
+       ldy pointer
+       lda y[Object_table_lo]
+       sta addr
+       lda y[Object_table_hi]
+       sta addr+1
+}    
+
+macro fGetClassAddr Address {
+       jsr fGet_Class
+       stx Address
+       sta Address+1
+}    
+
+macro fGetSoundAddr Address {
+       jsr fGet_Sound
+       stx Address
+       sta Address+1
+}    
+
+macro fGetImageAddr Address {
+       jsr fGet_Image
+       stx Address
+       sta Address+1
+}    
+
+macro fGetActionAddr Address {
+       jsr fGet_Action
+       stx Address
+       sta Address+1
+}    
+
+macro fGetObjectAddr Address {
+       jsr fGet_Object
+       stx Address
+       sta Address+1
+}    
+
+macro lGetClassAddr pointer,Addr {
+       ldy pointer
+       fGetClassAddr   Addr
+}
+
+macro lGetSoundAddr pointer,Addr {
+       ldy pointer
+       fGetSoundAddr   Addr
+}
+
+macro lGetImageAddr pointer,Addr {
+       ldy pointer
+       fGetImageAddr   Addr
+}    
+
+macro lGetActionAddr pointer,Addr {
+       ldy pointer
+       fGetActionAddr  Addr
+}    
+
+macro lGetObjectAddr pointer,Addr {
+       ldy pointer
+       fGetObjectAddr  Addr
+}    
+
+; ----------------------------------------------------------------------
+; Put Address indirect macros
+; ----------------------------------------------------------------------
+macro putClassAddr pointer,Addr {
+    
+       ldy pointer
+       lda Addr+1
+       sta y[Class_table_hi]
+       lda Addr
+       sta y[Class_table_lo]
+}    
+
+macro putSoundAddr pointer,Addr {
+    
+       ldy pointer
+       lda Addr+1
+       sta y[Sound_table_hi]
+       lda Addr
+       sta y[Sound_table_lo]
+}    
+
+macro putImageAddr pointer,Addr {
+    
+       ldy pointer
+       lda Addr+1
+       sta y[Image_table_hi]
+       lda Addr
+       sta y[Image_table_lo]
+}    
+
+macro putActionAddr pointer,Addr {
+    
+       ldy pointer
+       lda Addr+1
+       sta y[Action_table_hi]
+       lda Addr
+       sta y[Action_table_lo]
+}    
+
+macro putObjectAddr pointer,Addr {
+    
+       ldy pointer
+       lda Addr+1
+       sta y[Object_table_hi]
+       lda Addr
+       sta y[Object_table_lo]
+
+}    
+; ----------------------------------------------------------------------
+; Get refrence indirect macros
+; ----------------------------------------------------------------------
+macro GetClassref pointer {
+    
+       ldy pointer
+       lda y[Class_table_ref]
+}    
+
+macro GetSoundref pointer {
+    
+       ldy pointer
+       lda y[Sound_table_ref]
+}    
+
+macro GetImageref pointer {
+    
+       ldy pointer
+       lda y[Image_table_ref]
+}    
+
+macro GetActionref pointer {
+    
+       ldy pointer
+       lda y[Action_table_ref]
+}    
+
+macro GetObjectref pointer {
+    
+       ldy pointer
+       lda y[Object_table_ref]
+}    
+; ----------------------------------------------------------------------
+; Put refrence macros
+; ----------------------------------------------------------------------
+macro putClassref pointer {
+    
+       ldy pointer
+       sta y[Class_table_ref]
+}    
+
+macro putSoundref pointer {
+    
+       ldy pointer
+       sta y[Sound_table_ref]
+}    
+
+macro putImageref pointer {
+    
+       ldy pointer
+       sta y[Image_table_ref]
+}    
+
+macro putActionref pointer {
+    
+       ldy pointer
+       sta y[Action_table_ref]
+}    
+
+macro putObjectref pointer {
+    
+       ldy pointer
+       sta y[Object_table_ref]
+}    
diff --git a/sources/c64/Obj/equates.m b/sources/c64/Obj/equates.m
new file mode 100644 (file)
index 0000000..0aa4430
--- /dev/null
@@ -0,0 +1,249 @@
+;---------------------------------
+;
+;      defines and equates
+;
+
+       define  start_zpage     = 0x0010
+
+       define  chars_at_top    = 9
+       define  bitmap_offset   = chars_at_top*320
+       define  colormap_offset = chars_at_top*40
+
+       define  Screen_1        = 0x4000        ; for page flip
+       define  Screen_2        = 0x6000
+       define  Text_RAM_1      = 0x4400        ; can change w/ flip
+       define  Color_RAM       = 0xD800        ; fixed
+
+
+       define  Bitmap_screen_1 = screen_1   + bitmap_offset
+       define  Bitmap_screen_2 = screen_2   + bitmap_offset
+       define  back_drop       = 0xe000     + bitmap_offset
+       define  bitmap_text     = text_RAM_1 + colormap_offset
+       define  bitmap_colr     = color_RAM  + colormap_offset
+
+       define  Screen_height   = 128   ; scan lines in active area
+       define  Screen_width    = 40    ; bytes per scan line
+
+       define  swap_pat        = cartoon_buffer+12
+
+       define  rtstick         = 0b00001000    ; joystick bit masks
+       define  ltstick         = 0b00000100
+       define  dnstick         = 0b00000010
+       define  upstick         = 0b00000001
+
+       define  run             = 0x00  ; used in run_length decoding in paint
+
+       define  type_sky        = 0
+       define  type_wall       = 1
+       define  type_grnd       = 2
+       define  type_nogo       = 3
+
+       define  bg      = 0x00                  ; background object
+       define  fg      = 0x80                  ; foreground object
+
+       define  color_black     = 0x00
+       define  color_white     = 0x01
+       define  color_red       = 0x02
+       define  color_cyan      = 0x03
+       define  color_purple    = 0x04
+       define  color_green     = 0x05
+       define  color_blue      = 0x06
+       define  color_yellow    = 0x07
+       define  color_peach     = 0x08
+       define  color_brown     = 0x09
+       define  color_pink      = 0x0a
+       define  color_gray1     = 0x0b
+       define  color_gray2     = 0x0c
+       define  color_lgreen    = 0x0d
+       define  color_sky       = 0x0e
+       define  color_gray3     = 0x0f
+
+       define  pat_glass       = 0q0000        ; bitmap patterns
+       define  pat_sky         = 0q0000        ; bitmap patterns
+       define  pat_wild        = 0q1111
+       define  pat_black       = 0q2222
+       define  pat_pink        = 0q3333
+
+       define  AVATAR_LEG_LIMB         =       0
+       define  AVATAR_TORSO_LIMB       =       1
+       define  AVATAR_ARM_LIMB         =       2
+       define  AVATAR_FACE_LIMB        =       3
+
+
+
+;****************************************
+;      CHARACTERS USED IN SIGNS!
+;****************************************
+
+       define  char_space                      = 0x20
+       define  char_delete                     = 0x7c
+
+
+       define  shift_0                         = 128 + 0
+       define  shift_plus                      = 128 + 1
+       define  shift_minus                     = 128 + 2
+       define  shift_asterisk                  = 128 + 3
+       define  shift_at                        = 128 + 4
+       define  shift_equal                     = 128 + 5
+       define  sign_char_return_key            = 128 + 6
+       define  cursor_right                    = 128 + 7
+       define  cursor_left                     = 128 + 8
+       define  cursor_up                       = 128 + 9
+       define  cursor_down                     = 128 + 10
+       define  home_key                        = 128 + 11
+       define  clear_key                       = 128 + 12
+       define  british_pound                   = 128 + 13
+       define  insert_key                      = 128 + 14
+       define  shift_british_pound             = 128 + 15
+
+
+       define  start_text                      = insert_key
+       define  sign_char_half_space            = shift_0
+       define  sign_char_double_space          = shift_british_pound
+       define  sign_char_inc_width             = shift_plus
+       define  sign_char_dec_width             = shift_minus
+       define  sign_char_inc_height            = shift_asterisk
+       define  sign_char_dec_height            = shift_at
+       define  sign_char_half_size             = shift_equal
+       define  sign_char_half_char_down        = home_key
+       define  sign_char_inverse_video         = clear_key
+       define  sign_char_cursor_right          = cursor_right
+       define  sign_char_cursor_left           = cursor_left
+       define  sign_char_cursor_up             = cursor_up
+       define  sign_char_cursor_down           = cursor_down
+
+
+;      Graphic data in the form of...
+;
+;      How Held + # of states                          1 byte
+;      Which cels change color_ram                     1 byte
+;      Offset to graphic state tables                  1 byte
+;      Container?  if yes, offset for x/y tables       1 byte
+       define  image_walk_offset                       = 4     ; 3 bytes
+;                                                      -------
+       define  Header_total                            = 7
+
+
+
+       define  left            = 0x00          ; walkto object facing!
+       define  right           = 0x01
+       define  up              = 0x02
+       define  down            = 0x03
+
+
+
+;      FIRST BYTE IN CEL
+       define  cel_cel         = 0b00000000
+       define  cel_trap        = 0b01000000
+       define  cel_box         = 0b10000000
+       define  cel_circle      = 0b11000000
+       define  cel_mask        = 0b11000000
+       define  cel_text        = 0b00100000
+       define  cel_wid_mask    = 0b00001111
+
+       define  lr_bord         = 0b00100000    ; borders on boxes
+       define  tb_bord         = 0b00010000
+       define  both_bord       = 0b00110000
+
+       define  col             = 0b00000000    ; get color or pattern
+       define  pat             = 0b00010000
+
+
+;      FIRST BYTE OF GRAPHIC DESCRIPTER
+       define  swing           = 0b00000000    ; how objects are held
+       define  out             = 0b01000000    ; 2nd two bits
+       define  both            = 0b10000000
+       define  at_side         = 0b11000000
+       define  hold_mask       = 0b11000000
+
+       define  state_mask      = 0b00111111    ; # of graphic states (0-63)
+
+;;     define  swing           = 0b00000000    ; how objects are held
+;;     define  out             = 0b00100000    ; 2nd two bits
+;;     define  both            = 0b01000000
+;;     define  at_side         = 0b01100000
+;;     define  hold_mask       = 0b01100000
+;;
+;;     define  state_mask      = 0b00011111    ; # of graphic states (0-31)
+
+
+;      ANIMATION DATA
+       define  no_animation    = 0b00000000
+       define  cycle           = 0b10000000    ; high bit cycle animation
+       define  cycle_mask      = 0b10000000
+
+       define  no_cont         = 0b00000000
+
+;      ORIENTATION BYTE
+       define  st_colr         = 0b10000000            ; whether trap stores
+       define  no_colr         = 0b00000000            ; into color_map
+       define  color_mask      = 0b11111000            ; if color, and color
+
+
+       define  orient_right    = 0b00000000
+       define  orient_left     = 0b00000001
+;;     define  orient_forward  = 0b00000010
+;;     define  orient_back     = 0b00000011
+       define  cel_dx_mask     = 0b00000001
+;;     define  face_left_bit   = 0b00000100
+
+
+;      AVATARS use of OBJECT_animation_state
+
+       define  invisible_bit   = 0b10000000
+       define  moonwalk_bit    = 0b00000001
+       define  avatar_on_hold  = 0b01000000    ; don't draw for now
+                                               ; DIFFERENT from invis.
+;      OBJECT_animation_start
+;      define  new_head_facing = 0b10000000
+;      define  head_gr_state   = 0b00000011
+
+;      OBJECT_animation_end
+       define  walk_end_chore  = 0b00000011
+       define  on_my_way       = 0b00001000    ; 0 if at_destination
+       define  walk_this_way   = 0b10000000
+
+
+
+;      define  AV_ACT_init             = 0x80  + 0
+       define  AV_ACT_stand            = 0x80  + 1
+       define  AV_ACT_walk             = 0x80  + 2
+       define  AV_ACT_hand_back        = 0x80  + 3
+       define  AV_ACT_sit_floor        = 0x80  + 4
+       define  AV_ACT_sit_chair        = 0x80  + 5
+       define  AV_ACT_bend_over        = 0x80  + 6
+       define  AV_ACT_bend_back        = 0x80  + 7
+       define  AV_ACT_point            = 0x80  + 8
+       define  AV_ACT_throw            = 0x80  + 9
+       define  AV_ACT_get_shot         = 0x80  + 10
+       define  AV_ACT_jump             = 0x80  + 11
+       define  AV_ACT_punch            = 0x80  + 12
+       define  AV_ACT_wave             = 0x80  + 13
+       define  AV_ACT_frown            = 0x80  + 14
+       define  AV_ACT_stand_back       = 0x80  + 15
+       define  AV_ACT_walk_front       = 0x80  + 16
+       define  AV_ACT_walk_back        = 0x80  + 17
+       define  AV_ACT_stand_front      = 0x80  + 18
+       define  AV_ACT_unpocket         = 0x80  + 19
+       define  AV_ACT_gimme            = 0x80  + 20
+       define  AV_ACT_knife            = 0x80  + 21
+       define  AV_ACT_arm_get          = 0x80  + 22
+       define  AV_ACT_hand_out         = 0x80  + 23
+       define  AV_ACT_operate          = 0x80  + 24
+       define  AV_ACT_arm_back         = 0x80  + 25
+       define  AV_ACT_shoot1           = 0x80  + 26
+       define  AV_ACT_shoot2           = 0x80  + 27
+       define  AV_ACT_nop              = 0x80  + 28
+       define  AV_ACT_sit_front        = 0x80  + 29
+
+
+       define  AV_ACT_help_key         = 0x80  + 122
+
+       define  AV_ACT_stand_left       = 0x80  + 123
+       define  AV_ACT_stand_right      = 0x80  + 124
+
+       define  AV_ACT_change_color     = 0x80  + 125
+       define  AV_ACT_face_left        = 0x80  + 126
+       define  AV_ACT_face_right       = 0x80  + 127
+
+
diff --git a/sources/c64/Obj/farmers_equates.m b/sources/c64/Obj/farmers_equates.m
new file mode 100644 (file)
index 0000000..b7a821f
--- /dev/null
@@ -0,0 +1,372 @@
+define Q3                      =       True
+define dump_enabled            =       False
+define command_entry           =       0x00
+define async_entry             =       0xff
+
+define top_of_heap             =       0xeb40
+define OBUFFS                  =       0x4800  ; max_buffs*128 (512)
+
+define request_buffers         =       0x6800  ; max_request_buffers*128(256)
+define region_contents_list    =       0x6900  ; region_max_capacity (128)
+define text_line               =       0x6980  ; 
+
+define RSINBF                  =       0x7f40  ; 128
+define history                 =       0x7fc0  ; 64
+
+; fatal errors
+define user_requested_dump     =       0       ; no TRAPPED error occurred
+define memory_full             =       1
+define memory_fault            =       2
+define memory_corrupt          =       3       ; lrc got corrupted
+define indirect_address_error  =       4
+define bad_image_state         =       5
+define no_room_for_head        =       6
+define indirect_address_jmp    =       7
+define indirect_address_rts    =       8
+define heap_overrun            =       9
+define invalid_comm            =       10
+define missing_object          =       11
+define bad_link_attempt        =       12
+define very_bad_links          =       13
+define host_requested_dump     =       47
+
+; warnings:
+define simple_disk_error       =       128     ; returned by rom
+define disk_write_error        =       129     ; write protect(?)
+define sector_lrc_error        =       130     ; transmission problem  
+
+define SUCCESS_VALUE           =       1       ; any other is false
+
+define ghost_noid              =       255
+
+define short_async_frames              =       5       ; max frames to wait
+define long_async_frames               =       56
+
+define Default_Throttle_Increment      =       15      ; jiffies (1200 baud)
+define Default_Throttle_Decrement      =       -15     ; jiffies (1200 baud)
+
+define one_minute              =       60*60
+
+define special_mode            =       1
+
+define max_number_of_heads     =       31
+define getdrop_offset          =       16              ; pixel offset
+define region_max_capacity     =       128
+
+define LRU_bits                =       0b11000000
+define ref_bits                =       255-LRU_bits
+define oldest_LRU              =       0b01000000
+define old_LRU                 =       0b10000000
+define just_deleted            =       0b11000000
+
+define mid_header      =       8
+define seq_header      =       9
+define obj_header      =       10              ; only ALWAYS true in resps
+define req_header      =       11              ; ditto
+define resp_data       =       12              ; ditto
+
+define end_of_request_bit      =       0b10000000
+define start_of_request_bit    =       0b00100000
+define fixed_on_bits           =       0b01000000
+
+define direction_left          = 0     ; for region trans
+define direction_up            = 1
+define direction_right         = 2
+define direction_down          = 3
+
+define command_DO              =       0
+define command_GO              =       2
+define command_STOP            =       3
+define command_GET             =       4
+define command_PUT             =       5
+define command_TALK            =       6
+define special_command         =       8       ; lowest special command #
+
+; region TYPES
+define SHOWROOM_region_type    =       0b10000000
+
+; region messages
+define MESSAGE_describe        =       1
+define MESSAGE_I_quit          =       2
+define MESSAGE_Im_alive        =       3
+define MESSAGE_customize       =       4
+define MESSAGE_FINGER_IN_QUE   =       5               ; while catchup
+define MESSAGE_HERE_I_AM       =       6               ; materialize!
+define MESSAGE_PROMPT_REPLY    =       7
+
+define MESSAGE_HEREIS          =       8
+define MESSAGE_GOAWAY          =       9               ; object has left
+define MESSAGE_PORT            =       10              ; we have moved!
+define MESSAGE_UPDATE_DISK     =       11              ; update disk..
+define MESSAGE_FIDDLE          =       12              ; fiddle with object
+define MESSAGE_LIGHTING        =       13              ; change light level
+define MESSAGE_MUSIC           =       14              ; play a tune
+define MESSAGE_OBJECT_TALKS    =       15              ; an object speaks!
+define MESSAGE_WAIT_FOR_ANI    =       16              ; wait for an object
+define MESSAGE_CAUGHT_UP       =       17
+define MESSAGE_APPEAR          =       18
+define MESSAGE_CHANGE_CONT     =       19
+define MESSAGE_PROMPT_USER     =       20
+define MESSAGE_BEEN_MOVED      =       21
+define  MESSAGE_HOST_DUMP      =       22
+
+; object messages
+define MESSAGE_answer          =       4
+define MESSAGE_askoracle       =       4
+define MESSAGE_attack          =       4
+define MESSAGE_bash            =       5
+define MESSAGE_bugout          =       4
+define MESSAGE_catalog         =       5
+define MESSAGE_close           =       4
+define MESSAGE_closecontainer  =       4
+define MESSAGE_deposit         =       1
+define MESSAGE_dial            =       5
+define MESSAGE_fakeshoot       =       4
+define MESSAGE_feed            =       4
+define MESSAGE_fill            =       4
+define MESSAGE_flush           =       6
+define MESSAGE_get             =       1
+define MESSAGE_grab            =       4
+define MESSAGE_hand            =       5
+define MESSAGE_hang            =       6
+define MESSAGE_load            =       6
+define MESSAGE_magic           =       4
+define MESSAGE_newregion       =       9
+define MESSAGE_off             =       4
+define MESSAGE_offplayer       =       4
+define MESSAGE_on              =       5
+define MESSAGE_onplayer        =       5
+define MESSAGE_open            =       5
+define MESSAGE_opencontainer   =       5
+define MESSAGE_pay             =       4
+define MESSAGE_payto           =       4
+define MESSAGE_playmessage     =       4
+define MESSAGE_posture         =       6
+define MESSAGE_pour            =       5
+define MESSAGE_pullpin         =       4
+define MESSAGE_put             =       2
+define MESSAGE_read            =       4
+define MESSAGE_readlabel       =       4
+define MESSAGE_readmail        =       4
+define MESSAGE_readme          =       4
+define MESSAGE_reset           =       5
+define MESSAGE_roll            =       4
+define MESSAGE_rub             =       4
+define MESSAGE_scan            =       4
+define MESSAGE_select          =       6
+define MESSAGE_sendmail        =       5
+define MESSAGE_setanswer       =       5
+define MESSAGE_speak           =       7
+define MESSAGE_take            =       4
+define MESSAGE_talk            =       7
+define MESSAGE_throw           =       3
+define MESSAGE_throwaway       =       3
+define MESSAGE_unhook          =       8
+define MESSAGE_unload          =       7
+define MESSAGE_walk            =       8
+define MESSAGE_wind            =       4
+define MESSAGE_wish            =       5
+define MESSAGE_withdraw        =       2
+define MESSAGE_write           =       5
+define MESSAGE_zapto           =       5
+
+define MESSAGE_esp_speak       =       11
+
+define separator_byte          =       0x00    ; can NOT be valid class/NOID
+
+define vic_bank_bits           = 0b10          ; BANK 1 for VIC
+define vic_bank_start          = 0x4000
+define charset_at              = 0x6000        ; (+0x2000)
+define sprites_at              = 0x4000        ; (+0x0000)
+define customize_hold_area     = 0x7800
+define customize_target        = back_drop - 0x800
+
+define sprite_pointers         = text_RAM_1 + 0x3f8
+define text_window_size        = 7
+define text_window_width       = 40
+define max_balloon_size        = 3
+
+define max_BUFFS                       =       4       ; protocol out buffs
+define max_req_buffers                 =       2       ; valid 2,4,8,16
+define response_free_space             =       768
+define buffer_base                     =       response_buffers
+define buffer_end              =       response_buffers+response_free_space-2
+
+define reply_wait_bit          = 0b10000000
+define animation_wait_bit      = 0b01000000
+define draw_wait_bit           = 0b00100000
+define animation_init_flag     = 0b00010000
+define used_wait_bits          = 0b11100000
+
+define blank_char              = 0
+define cursor_char             = 0
+define delete_key              = 0xfe
+define clr_key                 = 0xfd
+define return_key              = 0x81
+define control_key             = 0x82
+define shift_right             = 0x83
+define shift_left              = 0x84
+define null_key                = 0x8f
+define nk                      = null_key
+define quit_key                = 0x91
+define function_key_1          = 0x92
+define function_key_2          = 0x93
+define function_key_3          = 0x94
+define function_key_4          = 0x95
+define function_key_5          = 0x96
+define function_key_6          = 0x97
+define function_key_7          = 0x98
+define function_key_8          = 0x99
+define gesture_key_1           = 0x9a
+define gesture_key_2           = 0x9b
+define gesture_key_3           = 0x9c
+define gesture_key_4           = 0x9d
+define gesture_key_5           = 0x9e
+define gesture_key_6           = 0x9f
+define gesture_key_7           = 0xa1
+define gesture_key_8           = 0xa2
+define gesture_key_9           = 0xa3
+define gesture_key_0           = 0xa4
+define gesture_max             = gesture_key_0
+define dump_key                = 0xb0
+define token_symbol            = '$'
+define escape_char             = 0x5d          ; not ASCII esc
+define end_of_message          = 0x0d          ; cr
+define mid_byte                = 'U'
+define phantom_request         = 'Z'
+
+define max_text_line_length    =       100
+
+define kb_buffer_length        =       32      ; valid: 2,4,8,16,32,64,128
+define text_screen_address     =       Text_Ram_1      ;(40 * 24)+Text_RAM_1
+;;define       text_screen2_address    =       (40 * 24) + Text_RAM_2
+define max_text_display_length =       40
+define text_color              =       white
+
+define flash_rate              =       16
+define quip_y                  =       text_window_size * 8 + 50 + 8
+define cursor_left_bound       =       12 / 2
+define cursor_right_bound      =       332 / 2
+define cursor_top_bound        =       quip_y - 1
+define cursor_top_interrupt    =       quip_y + 2
+define cursor_bottom_bound     =       240
+define cursor_over_interrupt   =       999             ;221
+define cursor_sprite           =       5
+define cursor_position         =       cursor_sprite * 2 + sprite_position
+define normal_cursor           =       0
+define do_cursor               =       1
+define go_cursor               =       2
+define stop_cursor             =       3
+define get_cursor              =       4
+define put_cursor              =       5
+define pen_cursor              =       6
+
+define black                   =       0x00
+define white                   =       0x01
+define red                     =       0x02
+define cyan                    =       0x03
+define purple                  =       0x04
+define green                   =       0x05
+define blue                    =       0x06
+define yellow                  =       0x07
+define orange                  =       0x08
+define brown                   =       0x09
+define light_red               =       0x0a
+define gray_1                  =       0x0b
+define gray_2                  =       0x0c
+define light_green             =       0x0d
+define light_blue              =       0x0e
+define gray_3                  =       0x0f
+
+define D6510                   =       0x00
+define data_direction          =       0x00
+define R6510                   =       0x01
+define IO_reg                  =       0x01
+
+define sprite_position         =       0xd000
+define sprite_x_msb            =       0xd010
+define VIC_control             =       0xd011
+define IRQ_scanline            =       0xd012
+define sprite_enable           =       0xd015
+define VIC_control_2           =       0xd016
+define expand_sprite_y         =       0xd017
+define VIC_memory_control      =       0xd018
+define IRQ_flag                =       0xd019
+define IRQ_mask                =       0xd01a
+define sprite_priority         =       0xd01b
+define multicolor_sprite       =       0xd01c
+define expand_sprite_x         =       0xd01d
+define sprite_collision        =       0xd01e
+define backround_collision     =       0xd01f
+define background_collision    =       0xd01f
+define border_color            =       0xd020
+define background_color        =       0xd021
+define background_color_0      =       0xd021
+define background_color_1      =       0xd022
+define background_color_2      =       0xd023
+define background_color_3      =       0xd024
+define multicolor_0            =       0xd025
+define multicolor_1            =       0xd026
+define sprite_colors           =       0xd027
+
+define Joystick_port_2         =       0xdc00
+define Joystick_port_1         =       0xdc01
+define data_direction_1        =       0xdc02
+define data_direction_2        =       0xdc03
+define interrupt_control       =       0xdc0d
+define IRQ_interrupt           =       0xdc0d
+define IRQ_timer_a             =       0xdc0e
+define IRQ_timer_b             =       0xdc0f
+
+define data_port_a             =       0xdd00
+define data_port_b             =       0xdd01
+define data_direction_a        =       0xdd02
+define data_direction_b        =       0xdd03
+define timer_a                 =       0xdd04
+define timer_b                 =       0xdd06
+define real_clock              =       0xdd08
+define NMI_interrupt           =       0xdd0d
+define NMI_timer_a             =       0xdd0e
+define NMI_timer_b             =       0xdd0f
+
+define ioinit  =       0xff84
+define setlfs  =       0xffba
+define setnam  =       0xffbd
+define open    =       0xffc0
+define chkout  =       0xffc9
+define chrout  =       0xffd2
+define clrchn  =       0xffcc
+define close   =       0xffc3
+
+; special characters in the character set:
+; D = Down U = Up L = Left R = Right C = Center
+
+define Diag_DR         =       9
+define Diag_DL         =       31              ;10 is linefeed!
+define Diag_UL         =       11
+define Diag_UR         =       12
+define Box_DR          =       13
+define Box_DL          =       14
+define Box_UL          =       15
+define Box_UR          =       16
+define Circ_DR         =       17
+define Circ_DL         =       18
+define Circ_UL         =       19
+define Circ_UR         =       20
+define Box_CR          =       21
+define Box_CL          =       22
+define Box_CU          =       23
+define Box_CD          =       24
+define Box_C           =       25
+define Line_UD         =       26
+define Line_LR         =       27
+define Ball            =       28
+define Ball_filled     =       29
+define Ball_alternate  =       30
+define Arrow_U         =       124
+define Arrow_D         =       125
+define Arrow_L         =       126
+define Arrow_R         =       127
+define Squiggle        =       123
+define Black_char      =       96
diff --git a/sources/c64/Obj/macros.m b/sources/c64/Obj/macros.m
new file mode 100644 (file)
index 0000000..7cdc53f
--- /dev/null
@@ -0,0 +1,385 @@
+; ================================================================
+; some auxiliary functions for the macros that follow
+;
+
+; MAKE-FIRST-BYTE - access low byte for any addressing mode
+function makeFirstByteImmediate(operand) {
+       freturn(/operand)
+}
+function makeFirstByte(operand) {
+       freturn(operand)
+}
+
+; MAKE-SECOND-BYTE - access high byte for any addr mode except (post y zzz)
+function makeSecondByteImmediate(operand) {
+       freturn(?operand)
+}
+function makeSecondByte(operand) {
+       freturn(operand + 1)
+}
+
+; MAKE-NTH-BYTE - similarly access arbitrary byte
+function makeNthByteImmediate(operand, n) {
+       freturn((operand >> (8 * (n - 1))) & 0xFF)
+}
+function makeNthByte(operand, n) {
+       freturn(operand + n - 1)
+}
+
+; ================================================================
+; MOVM, MOVEB, MOVB, MOVEW, MOVW, CLEARB, and CLEARW
+; Note that the args on MOVEx are src,dst as opposed to
+; MOVx, which uses dst,src.
+; 
+
+; MOVEB - move byte from src to dst
+macro  moveb   src, dst {
+       lda     src
+       sta     dst
+}
+
+
+; MOVEW - move word from src to dst
+;      works for all addressing moves EXCEPT (post y zzz)
+macro  movew   src, dst {
+       mif (isImmediateMode(src)) {
+               lda     makeFirstByteImmediate(src) 
+               sta     makeFirstByte(dst)
+               lda     makeSecondByteImmediate(src)
+               sta     makeSecondByte(dst)
+       } melse {
+               lda     makeFirstByte(src) 
+               sta     makeFirstByte(dst)
+               lda     makeSecondByte(src)
+               sta     makeSecondByte(dst)
+       }
+}
+
+; CLEARB - zero byte dst
+macro  clearb  dst {
+       lda     #0
+       sta     dst
+}
+
+; CLEARW - zero word dst
+;      works for all addressing modes EXCEPT (post y dst)
+macro  clearw  dst {
+       lda     #0
+       sta     makeFirstByte(dst)
+       sta     makeSecondByte(dst)
+}
+
+
+; ================================================================
+; the general macros
+; 
+
+; ADDB - byte dst = byte src0 + byte src1
+macro  addb    dst, src0, src1 {
+       clc
+       lda     src0
+       adc     src1
+       sta     dst
+}
+
+; ADDW - word dst = word src0 + word src1
+;      works for all addressing modes EXCEPT (post y zzz)
+macro addw dst, src0, src1 {
+       clc
+       mif (isImmediateMode(src0)) {
+               lda     makeFirstByteImmediate(src0)
+       } melse {
+               lda     makeFirstByte(src0)
+       }
+       mif (isImmediateMode(src1)) {
+               adc     makeFirstByteImmediate(src1)
+       } melse {
+               adc     makeFirstByte(src1)
+       }
+       sta     makeFirstByte(dst)
+       mif (isImmediateMode(src0)) {
+               lda     makeSecondByteImmediate(src0)
+       } melse {
+               lda     makeSecondByte(src0)
+       }
+       mif (isImmediateMode(src1)) {
+               adc     makeSecondByteImmediate(src1)
+       } melse {
+               adc     makeSecondByte(src1)
+       }
+       sta     makeSecondByte(dst)
+}
+
+; ADDWWB - word dst = word src0 + byte src1
+;      works for all addressing modes EXCEPT (post y zzz)
+macro  addwwb  dst, src0, src1 {
+       clc
+       mif (isImmediateMode(src0)) {
+               lda     makeFirstByteImmediate(src0)
+       } melse {
+               lda     makeFirstByte(src0)
+       }
+       adc     src1
+       sta     makeFirstByte(dst)
+       mif (isImmediateMode(src0)) {
+               lda     makeSecondByteImmediate(src0)
+       } melse {
+               lda     makeSecondByte(src0)
+       }
+       adc     #0
+       sta     makeSecondByte(dst)
+}
+
+; SUBB - byte dst = byte src0 - byte src1
+macro  subb    dst, src0, src1 {
+       sec
+       lda     src0
+       sbc     src1
+       sta     dst
+}
+
+; SUBW - word dst = word src0 - word src1
+;      works for all addressing modes EXCEPT (post y zzz)
+macro  subw    dst, src0, src1 {
+       sec
+       mif (isImmediateMode(src0)) {
+               lda     makeFirstByteImmediate(src0)
+       } melse {
+               lda     makeFirstByte(src0)
+       }
+       mif (isImmediateMode(src1)) {
+               sbc     makeFirstByteImmediate(src1)
+       } melse {
+               sbc     makeFirstByte(src1)
+       }
+       sta     makeFirstByte(dst)
+       mif (isImmediateMode(src0)) {
+               lda     makeSecondByteImmediate(src0)
+       } melse {
+               lda     makeSecondByte(src0)
+       }
+       mif (isImmediateMode(src1)) {
+               sbc     makeSecondByteImmediate(src1)
+       } melse {
+               sbc     makeSecondByte(src1)
+       }
+       sta     makeSecondByte(dst)
+}
+
+; SUBWWB - word dst = word src0 - byte src1
+;      works for all addressing modes EXCEPT (post y zzz)
+macro  subwwb  dst, src0, src1 {
+       sec
+       mif (isImmediateMode(src0)) {
+               lda     makeFirstByteImmediate(src0)
+       } melse {
+               lda     makeFirstByte(src0)
+       }
+       sbc     src1
+       sta     makeFirstByte(dst)
+       mif (isImmediateMode(src0)) {
+               lda     makeSecondByteImmediate(src0)
+       } melse {
+               lda     makeSecondByte(src0)
+       }
+       sbc     #0
+       sta     makeSecondByte(dst)
+}
+
+; ================================================================
+; repeat n {code. . .}
+;      repeat n instances of code.  e.g.,
+;      repeat 6 {
+;              lda     x[foo]
+;              sta     x[bar]
+;              inx
+;      }
+;      will generate inline code to move 6 bytes
+; 
+macro  repeat  count, blockToRepeat {
+       mvariable i = count
+       mwhile (i-- > 0) {
+               blockToRepeat
+       }
+}
+
+macro  includef fname {
+       printf("Including %s\n", fname)
+       include fname
+}
+
+
+;
+;      Fill - Fill dst with Nbytes of fillchar - destroys A, X, Y.
+;              valid for 32K > Nbytes > 1
+;
+;      The new destination is
+;      the base destination plus as many whole pages
+;      as are in the number of bytes to transfer
+
+macro  fill    dst, nbytes, fillchar {
+
+       movew   #(dst+((nbytes-1)&0xFF00)),temp_address
+       lda     #fillchar
+       sta     (dst + nbytes - 1)      ; Last byte is special case
+
+       ldy     #/(nbytes - 1)  ; Start by transfering fractional page
+       ldx     #?(nbytes - 1)  ; X counts number of whole pages, backwards
+       jsr     DoFill          ; go do it
+
+}                              ; End Fill
+
+
+;****************************************
+;      Randy's macros
+;****************************************
+
+macro  ADD16   a1,a2,ds {
+    addw ds,a1,a2
+}
+
+macro  SUB16   s1,s2,ds {
+    subw ds,s1,s2
+}
+
+macro  CMP16   src0, src1 {
+       sec
+       mif (isImmediateMode(src0)) {
+               lda     makeFirstByteImmediate(src0)
+       } melse {
+               lda     makeFirstByte(src0)
+       }
+       mif (isImmediateMode(src1)) {
+               sbc     makeFirstByteImmediate(src1)
+       } melse {
+               sbc     makeFirstByte(src1)
+       }
+       mif (isImmediateMode(src0)) {
+               lda     makeSecondByteImmediate(src0)
+       } melse {
+               lda     makeSecondByte(src0)
+       }
+       mif (isImmediateMode(src1)) {
+               sbc     makeSecondByteImmediate(src1)
+       } melse {
+               sbc     makeSecondByte(src1)
+       }
+}
+
+macro  TEST16  src0, src1 {
+       mif (isImmediateMode(src0)) {
+               lda     makeFirstByteImmediate(src0)
+       } melse {
+               lda     makeFirstByte(src0)
+       }
+       mif (isImmediateMode(src1)) {
+               cmp     makeFirstByteImmediate(src1)
+       } melse {
+               cmp     makeFirstByte(src1)
+       }
+       if (equal) {
+       mif (isImmediateMode(src0)) {
+               lda     makeSecondByteImmediate(src0)
+       } melse {
+               lda     makeSecondByte(src0)
+       }
+       mif (isImmediateMode(src1)) {
+               cmp     makeSecondByteImmediate(src1)
+       } melse {
+               cmp     makeSecondByte(src1)
+       }
+       }
+}
+
+macro  INC16   w {
+    inc        w
+    if (zero) {
+       inc     w+1
+    }
+}
+
+macro  DEC16   w {
+    lda        w
+    if (zero) {
+       dec     w+1
+    }
+    dec        w
+}
+
+macro  BUMP    w {
+    clc
+    adc        w
+    sta        w
+    if (carry) {
+       inc     w+1
+    }
+}
+
+macro  LONGBUMP        w {
+    clc
+    adc        w
+    sta        w
+    lda        w+1
+    adc        #0
+    sta        w+1
+}
+
+
+
+macro  bank_IO_in {
+    lda        #0x25
+    sta        0x01
+}
+
+macro  bank_IO_in_y {
+    ldy        #0x25
+    sty        0x01
+}
+
+macro  save_and_bank_IO_in {
+    lda        0x01
+    pha
+    bank_IO_in
+}
+
+macro  bank_IO_out {
+    lda        #0x24
+    sta        0x01
+}
+
+macro  bank_IO_out_y {
+    ldy        #0x24
+    sty        0x01
+}
+
+macro  restore_IO {
+    pla
+    sta        0x01
+}
+
+macro  read_file_directory     fnam {
+       movew   fnam,   directory_start
+       jsr     read_into_cache
+}
+
+macro  inc_border_color {
+    save_and_bank_io_in
+    inc        border_color
+    restore_io
+}
+
+macro  error errnum {
+    sta        error_regs_a
+    lda        #errnum
+    jsr        process_error
+}
+
+macro waitfor num {
+       do {
+               lda switcher
+               cmp num
+       } until (equal)
+       lda     #0
+       sta     switcher
+}
+
diff --git a/sources/c64/Obj/page4_space.m b/sources/c64/Obj/page4_space.m
new file mode 100644 (file)
index 0000000..eae945c
--- /dev/null
@@ -0,0 +1,54 @@
+;      variable space availible 0x400 - 0x800
+;      NOTE: THIS FILE IS ASSEMBLED INTO all action code....
+
+               org     0x200
+class_table_hi::       block   256
+class_table_lo::       block   256
+
+arguments::    block   128
+end_arguments:
+               org     arguments
+desired_x::            block   1               ; for go actions
+desired_y::            block   1
+walk_how::             block   1
+last_command_selected::        block   1
+go_success::           block   1
+prevent_region_trans:: block   1
+
+               org     arguments
+container::    block   1                       ; for drop actions
+container_x::  block   1
+container_y::  block   1
+obj_orient::   block   1
+
+               org     arguments
+NewRegionDirection::   block   1
+
+               org     end_arguments
+object_list::          block   region_max_capacity     ; active objects
+
+               org     0x500
+rs232_input::          block   256
+rs232_output::         block   256
+disk_buffer::
+balloon_work_area::            ;(text_window_width*max_balloon_size);
+sort_y::
+                       block   128
+balloon_work_area_2::
+                       block   128
+
+
+; KEEP THE NEXT 9 BYTES IN A BLOCK
+terrain_type::         block   1
+light_level::          block   1       
+region_depth::         block   1
+region_class::         block   1
+Who_am_I::             block   1
+bank_account_balance:: block   4               ; THERE IS SPACE
+printf_parameters::    block   4               ; FROM  0x800 to 0x816
+region_trans_type::    block   1               ; 0/1-walk 2/3-port etc.
+select_value::         block   2
+Im_sitting::           block   1
+new_region_flag::      block   1
+change_background_object::     block   1
+async_workspace::      block   4               ; for ASYNC BEHAVIOURS
diff --git a/sources/c64/Obj/ronmacros2.m b/sources/c64/Obj/ronmacros2.m
new file mode 100644 (file)
index 0000000..65b2a55
--- /dev/null
@@ -0,0 +1,547 @@
+function set1bit (bp1) {
+
+       freturn 1<<bp1
+
+       }
+
+function set2bits (bp1,bp2) {
+
+       freturn (1<<bp1) | (1<<bp2)
+
+       }
+
+function set3bits (bp1,bp2,bp3) {
+
+       freturn (1<<bp1) | (1<<bp2) | (1<<bp3)
+
+       }
+
+function set4bits (bp1,bp2,bp3,bp4) {
+
+       freturn (1<<bp1) | (1<<bp2) | (1<<bp3) | (1<<bp4)
+
+       }
+
+macro lockup color {
+    lda color
+    sta 0xd020
+temp: jmp temp
+}
+
+
+macro stxy addr {
+    
+    stx addr
+    sty addr+1
+}
+
+macro ldxy addr {
+
+       mif (isImmediateMode(addr)) {
+               ldx     makeFirstByteImmediate(addr) 
+               ldy     makeSecondByteImmediate(addr)
+       } melse {
+               ldx     makeFirstByte(addr) 
+               ldy     makeSecondByte(addr)
+       }
+}
+
+macro movemb   src, dst[] {
+       mif (!isAregister(src)) {
+           lda src
+       }
+       mvariable i
+       mvariable num = arraylength(dst)
+       mfor (i=0, i<num, ++i) {
+           sta dst[i]
+       }
+}
+
+macro movemw   src, dst[] {
+       mvariable i
+       mif (isImmediateMode(src)) {
+           lda makeFirstByteImmediate(src) 
+       } melse {
+           lda makeFirstByte(src)
+       }
+       mfor (i=0, i<arraylength(dst), ++i) {
+           mif (isImmediateMode(dst[i])) {
+               lda makeFirstByteImmediate(dst[i]) 
+           } melse {
+               lda makeFirstByte(dst[i])
+           }
+       }
+       mif (isImmediateMode(src)) {
+           lda makeSecondByteImmediate(src)
+       } melse {
+           lda makeSecondByte(src)
+       }
+       mfor (i=0, i<arraylength(dst), ++i) {
+           mif (isImmediateMode(dst[i])) {     
+               sta makeSecondByteImmediate(dst[i])
+           } melse {
+               sta makeSecondByte(dst[i])
+           }
+       }
+}
+
+macro addlh destl,desth,src1l,src1h,src2l,src2h {
+
+       lda src1l
+       clc
+       adc src2l
+       sta destl
+
+       lda src1h
+       adc src2h
+       sta desth
+
+}
+
+macro addhl desth,destl,src1h,src1l,src2h,src2l {
+
+       lda src1l
+       clc
+       adc src2l
+       sta destl
+
+       lda src1h
+       adc src2h
+       sta desth
+
+}
+
+macro sublh destl,desth,src1l,src1h,src2l,src2h {
+
+       lda src1l
+       sec
+       sbc src2l
+       sta destl
+
+       lda src1h
+       sbc src2h
+       sta desth
+
+}
+
+macro subhl desth,destl,src1h,src1l,src2h,src2l {
+
+       lda src1l
+       sec
+       sbc src2l
+       sta destl
+
+       lda src1h
+       sbc src2h
+       sta desth
+
+}
+
+macro movehl srch,srcl , desth,destl {
+
+       lda srch
+       sta desth
+
+       lda srcl
+       sta destl
+
+}
+
+macro movelh srcl,srch , destl,desth {
+
+       lda srch
+       sta desth
+
+       lda srcl
+       sta destl
+
+}
+
+macro add num {
+
+       clc
+       adc num
+}
+
+macro sub num {
+
+       sec
+       sbc num
+}
+
+macro mbyte num,val {  
+
+       repeat num{
+         byte val
+       }
+
+}
+
+macro loop_up counter,start_loop,end_loop,ablock {
+
+       mif (isXregister(counter)) {
+            ldx start_loop
+       } melseif (isYregister(counter)) {
+                 ldy start_loop
+        } melse {
+                  lda start_loop
+                 sta counter
+       }
+
+       mif (IsImmediateMode(end_loop)) {
+       
+       do {
+           ablock
+
+           mif (isXregister(counter)) {
+                inx
+                cpx (end_loop+1)%256
+           } melseif (isYregister(counter)) {
+                     iny
+                     cpy (end_loop+1)%256
+           } melse {
+                     inc counter
+                     lda counter
+                     cmp (end_loop+1)%256
+           }
+       } until (equal)
+
+       } melse {
+       
+       do {
+           ablock
+
+           mif (isXregister(counter)) {
+                inx
+                cpx end_loop
+           } melseif (isYregister(counter)) {
+                     iny
+                     cpy end_loop
+           } melse {
+                     inc counter
+                     lda counter
+                     cmp end_loop
+           }
+
+       } until (gt)                              
+       }
+}
+
+macro loop_down counter,start_loop,end_loop,ablock {
+
+       mif (isXregister(counter)) {
+            ldx start_loop
+       } melseif (isYregister(counter)) {
+                 ldy start_loop
+        } melse {
+                  lda start_loop
+                 sta counter
+       }
+
+       mif (IsImmediateMode(end_loop)) {
+       
+       do {
+           ablock
+
+           mif (isXregister(counter)) {
+                dex
+                cpx (end_loop-1)%256
+           } melseif (isYregister(counter)) {
+                     dey
+                     cpy (end_loop-1)%256
+           } melse {
+                     dec counter
+                     lda counter
+                     cmp (end_loop-1)%256
+           }
+       } until (equal)
+
+       } melse {
+       
+       do {
+           ablock
+
+           mif (isXregister(counter)) {
+                dex
+                cpx end_loop
+           } melseif (isYregister(counter)) {
+                     dey
+                     cpy end_loop
+           } melse {
+                     dec counter
+                     lda counter
+                     cmp end_loop
+           }
+
+       } until (lt)                              
+       }
+}
+
+macro loop_to_zero counter,start_loop,ablock {
+
+       mif (isXregister(counter)) {
+            ldx start_loop
+       } melseif (isYregister(counter)) {
+                 ldy start_loop
+        } melse {
+                  lda start_loop
+                 sta counter
+       }
+
+       do {
+           ablock
+
+           mif (isXregister(counter)) {
+                dex
+           } melseif (isYregister(counter)) {
+                     dey
+           } melse {
+                     dec counter
+           }
+       } until (minus)
+}
+
+macro Set_Next_IRQ name,video_line {
+
+       movew #name,0xFFFE
+       moveb #video_line,0xd012
+       lda #0x81
+       sta 0xD019
+       sta 0xD01A
+       lda 0xDC0D
+
+}
+
+macro savereg reg1,reg2,reg3 {
+
+       mif (isdefined(reg1)) {
+           mif (isAregister(reg1)) {
+                   sta A_save
+           }
+           mif (isXregister(reg1)) {
+                   stx X_save
+           }
+           mif (isYregister(reg1)) {
+                   sty Y_save
+           }
+       }
+
+       mif (isdefined(reg2)) {
+           mif (isAregister(reg2)) {
+                   sta A_save
+           }
+           mif (isXregister(reg2)) {
+                   stx X_save
+           }
+           mif (isYregister(reg2)) {
+                   sty Y_save
+           }
+       }
+
+       mif (isdefined(reg3)) {
+           mif (isAregister(reg3)) {
+                   sta A_save
+           }
+           mif (isXregister(reg3)) {
+                   stx X_save
+           }
+           mif (isYregister(reg3)) {
+                   sty Y_save
+           }
+       }
+}
+
+
+macro loadreg reg1,reg2,reg3 {
+
+       mif (isdefined(reg1)) {
+           mif (isAregister(reg1)) {
+                   lda A_save
+           }
+           mif (isXregister(reg1)) {
+                   ldx X_save
+           }
+           mif (isYregister(reg1)) {
+                   ldy Y_save
+           }
+       }
+
+       mif (isdefined(reg2)) {
+           mif (isAregister(reg2)) {
+                   lda A_save
+           }
+           mif (isXregister(reg2)) {
+                   ldx X_save
+           }
+           mif (isYregister(reg2)) {
+                   ldy Y_save
+           }
+       }
+
+       mif (isdefined(reg3)) {
+           mif (isAregister(reg3)) {
+                   lda A_save
+           }
+           mif (isXregister(reg3)) {
+                   ldx X_save
+           }
+           mif (isYregister(reg3)) {
+                   ldy Y_save
+           }
+       }
+}
+
+macro dinc value {
+
+      inc value
+      if (equal) {
+         inc value+1
+      }
+}
+
+macro ddec value {
+
+       lda value
+       if (equal) {
+          dec value+1
+       }
+       dec value
+}
+
+macro incw value {
+
+      inc value
+      if (equal) {
+         inc value+1
+      }
+}
+
+macro decw value {
+
+       lda value
+       if (equal) {
+          dec value+1
+       }
+       dec value
+}
+
+macro movemem from,to,number {
+
+       movew #from,temp2
+       movew #to,temp3
+       movew #number,temp
+
+    mif(Isdefined(movefirst)) {
+       jsr move_mem_sub
+    } melse {
+        variable movefirst = 1
+       jsr move_mem_sub
+       jmp over_move_mem_sub
+move_mem_sub:
+       do {
+          ldy #0
+          lda y[@temp2]
+          sta y[@temp3]
+          dinc temp2
+          dinc temp3
+          ddec temp
+          lda temp
+          ora temp+1
+       } until(zero)
+       rts
+over_move_mem_sub:
+    }
+}
+   
+macro fillmem from,number,code {
+
+       movew from,temp2
+       movew number,temp3
+       lda temp3
+       sec
+       sbc temp2
+       sta temp3
+       lda temp3+1
+       sbc temp2+1
+       sta temp3+1
+       ldx code
+
+    mif(Isdefined(fillfirst)) {
+       jsr fill_mem_sub
+    } melse {
+        variable fillfirst = 1
+       jsr fill_mem_sub
+       jmp over_fill_mem_sub
+fill_mem_sub:
+       do {
+          ldy #0
+          txa
+          sta y[@temp2]
+          dinc temp2
+          ddec temp3
+          lda temp3
+          ora temp3+1
+       } until(zero)
+       rts
+over_fill_mem_sub:
+    }
+}
+   
+macro loop counter,start_loop,end_loop,ablock {
+
+       mif (end_loop==0) {
+            loop_to_zero counter,start_loop,ablock
+       } melse {
+            loop_up counter,start_loop,end_loop,ablock
+       }
+}
+
+;      } melseif ((start_loop>end_loop)&&
+;                 (isimmediatemode(start_loop))&&
+;                 (isimmediatemode(end_loop))) {
+;           loop_up counter,start_loop,end_loop,ablock
+;      } melse {
+;           loop_down counter,start_loop,end_loop,ablock
+;      }
+;}
+
+macro cmpw arg1,arg2 {
+    
+    mif(isImmediateMode(arg1)) {
+        lda MakeSecondByteImmedate(arg1)
+    } melse {
+        lda MakeSecondByte(arg1)
+    }          
+    mif(isImmediateMode(arg2)) {
+        cmp MakeSecondByteImmedate(arg2)
+    } melse {
+        cmp MakeSecondByte(arg2)
+    }          
+    if (equal) {
+       mif(isImmediateMode(arg1)) {
+           lda MakeFirstByteImmedate(arg1)
+       } melse {
+           lda MakeFirstByte(arg1)
+       }               
+       mif(isImmediateMode(arg2)) {
+           cmp MakeFirstByteImmedate(arg2)
+       } melse {
+           cmp MakeFirstByte(arg2)
+       }               
+    }
+}
+
+macro clx {
+    
+    ldx #0x00
+}
+
+macro cly {
+    
+    ldy #0x00
+}
+
+macro cla {
+    
+    lda #0x00
+}
diff --git a/sources/c64/Obj/zpage.m b/sources/c64/Obj/zpage.m
new file mode 100644 (file)
index 0000000..59783e4
--- /dev/null
@@ -0,0 +1,230 @@
+;
+;      Microcosm zero page variables
+;
+
+; DO NOT MOVE THESE! IF YOU DO, ALL OF THE ACTIONS WILL HAVE TO BE
+; RE_COMPILED AND SENT TO DISK......FRF
+
+temp_var_1:                            block   2       ; these may be used
+temp_var_2:                            block   2       ; as sort term zpage
+temp_var_3:                            block   2       ; space (NON-interrupt
+temp_var_4:                            block   2       ; routines)
+temp_var_5:                            block   2
+temp_var_6:                            block   2
+temp_var_7:                            block   2
+temp_var_8:                            block   2
+
+pointed_NOID:                          block   1       ; where is CURSOR? 
+pointed_object:                                block   2
+pointed_class:                         block   2
+pointed_variables_offset:              block   1
+
+actor_NOID:                            block   1       ; who is doing this?
+actor_object:                          block   2
+actor_class:                           block   2
+actor_variables_offset:                        block   1
+
+subject_NOID:                          block   1
+subject_object:                                block   2       ; to what?
+subject_class:                         block   2
+subject_variables_offset:              block   1
+
+in_hand_NOID:                          block   1       ; what is this avatar
+in_hand_object:                                block   2       ; holding?
+in_hand_class:                         block   2
+in_hand_variables_offset:              block   1
+
+me_noid:                               block   1
+waitfor_noid:                          block   1
+waitfor_object:                                block   2
+
+;      
+;              KEEP THIS BLOCK OF 7 BYTES TOGETHER!!!
+
+cel_address:           block   2               ; cel animation
+cel_x:                 block   1
+cel_y:                 block   1
+cel_dx:                        block   1
+cel_x_origin:          block   1
+cel_y_origin:          block   1
+cel_number:            block   1               ; LEAVE BLOCK TOGETHER!
+
+
+;              KEEP THIS BLOCK OF 14 BYTES TOGETHER!!!
+
+image_control:
+cel_width:             block   1
+cel_height:            block   1
+cel_x_offset:          block   1
+cel_y_offset:          block   1
+cel_x_rel:             block   1
+cel_y_rel:             block   1
+
+shape_pattern:                 block   1               ; color to fill/and pattern
+x1a:                   block   1               ; horiz_from
+x1b:                   block   1               ; horiz_to
+x2a:                   block   1
+x2b:                   block   1
+
+y1:                    block   1
+y2:                    block   1
+
+
+;              KEEP THIS BLOCK OF 6 BYTES TOGETHER!!!
+
+object_address:                block   2               ; MUST BE FIRST
+prop_address:          block   2               ; for drawing props
+drawing_which_object:  block   1
+d_wild:                        block   1
+
+;
+
+display_page:          block   1               ; general variables
+cel_index:             block   1
+
+screen_x:              block   1               ; cel painter
+screen_y:              block   1
+screen_x_limit:                block   1
+screen_y_limit:                block   1
+
+cel_state_table:       block   2               ; used in animate
+screen_address:                block   2               ; used by all!
+
+cartoon_buffer:                block   16              ; fast zero page line buffer
+
+display_window:                block   1               ; which window is current
+color_map_addr_1:      block   2               ; not used
+color_map_addr_2:      block   2               ; not used
+
+x_index:               block   1               ; # of bytes across line
+x1a_and_3:             block   1               ; used for speed
+x1b_and_3:             block   1
+or_value:              block   1               ; in plot
+
+pnt_tmp:               block   2               ; paint,motion
+plot_color:            block   1
+vcount:                        block   1               ; # of vertical lines
+
+delta_y:               block   1               ; trap info
+delta_x_a:             block   1
+delta_x_b:             block   1
+count_max_a:           block   1
+count_max_b:           block   1
+
+y1a_lo:                        block   1
+y1b_lo:                        block   1
+x1a_lo:                        block   1
+x1b_lo:                        block   1
+x1a_div_4:             block   1               ; get byte # across
+
+text_adr:              block   2               ; used in text
+v_count:               block   1
+h_count:               block   1
+x_temp:                        block   1               ; used in text
+y_temp:                        block   1
+
+background_render:     block   1
+object_count:          block   1               ; used in render
+temp_address:          block   2               ; used in Fill,paint,page
+
+
+;****************************************
+;      Ron's zero page
+;****************************************
+tbl_ptr1:              block   2
+tbl_ptr2:              block   2
+class_ptr1:            block   2
+object_ptr1:           block   2
+temp_ptr1:             block   2
+mem_ptr1:              block   2
+structure_ptr:         block   2
+temp2:                 block   2
+temp3:                 block   2
+
+switcher:              block   1               ; used by waitfor!
+
+object_list_pointer:   block   1               ; used by render
+largest_object:                block   1
+
+source:                        block   2
+destination:           block   2
+length:                        block   2
+
+save_a:                        block   1
+
+color:                 block   1
+text_line_length:      block   1               ; current kbinput byte #
+
+; comm_control.m
+request_buffer:                block   2
+response:              block   2
+
+; protocol.m
+TMPPNT:                        block   2
+TMPPNT_2:              block   2
+INDPTR:                        block   2
+packet:                        block   2
+p_output_buffer:       block   2
+CRC:                   block   2
+VALUE:                 block   1
+
+;  rs232.m
+
+rs232_input_bit:               block   1
+rs232_input_bit_count:         block   1
+rs232_start_bit_flag:          block   1
+rs232_input_byte:              block   1
+rs232_input_parity:            block   1
+rs232_output_bit_count:                block   1
+rs232_output_bit:              block   1
+rs232_output_byte:             block   1
+rs232_output_parity:           block   1
+rs232_control:                 block   1
+rs232_command:                 block   1
+rs232_status:                  block   1
+rs232_bit_count:               block   1
+rs232_rcv_buffer_end:          block   1
+rs232_rcv_buffer_start:                block   1
+rs232_send_buffer_start:       block   1
+rs232_send_buffer_end:         block   1
+rs232_enable:                  block   1
+
+rs232_input_buffer:            block   2
+rs232_output_buffer:           block   2
+rs232_timing:                  block   2
+rs232_half_time:               block   2
+
+; sfx
+sfx_sound:                             block   2
+
+; contents_vector
+response_data:                         block   2
+contents_list:                         block   2
+
+class_address:                         block   2
+state_variables_offset:                        block   1
+input_text_length:                     block   1
+orientation_byte:                      block   1
+pointed_at_cel_number:                 block   1
+horiz_and_mask:                                block   1       ; used for patterns
+vert_and_mask:                         block   1
+
+pointed_at_limb:                       block   1
+print_ptr:                             block   2
+c_value_ptr:                           block   2
+ASYNC_object:                          block   2
+target_routine:                                block   2       ; used for caller
+save_accumulator:                      block   1       ; used for caller
+save_status:                           block   1
+
+cursor_x:                              block   1
+cursor_y:                              block   1
+
+resource_table_hi:                     block   2
+resource_table_lo:                     block   2
+
+current_action_number:                 block   1
+desired_size:                          block   2       ; for alloc
+
+resource_table_ref:                    block   2
+object_noid:                           block   1
index 3ed4d79050cd921dcca9379ec204b3673d40d4ef..eb14713c64028448619a67752cf5f2cc5445f810 100644 (file)
@@ -1,3 +1,5 @@
+.SILENT:
+
 .SUFFIXES:     .sob .spb .bin .pwbin
 
 OBJECTS = \
@@ -27,6 +29,7 @@ crystal_ball.bin \
 crystal_ball.pwbin \
 door_closing.bin \
 door_opening.bin \
+door_opening.pwbin \
 error_beep.bin \
 escape_device_activates.bin \
 escape_device_used_up.bin \
@@ -146,16 +149,21 @@ region_change_music_v1.bin \
 region_change_music_v2.bin \
 spraycan.bin
 
+sounds: $(OBJECTS)
+
 .sob.bin:
+       echo making $*.bin
        cp org_statement temp.m
        cat $*.sob >>temp.m
-       macross temp.m  -o m.out
-       loadrom -p 0 -t < m.out > $*.bin
+       macross -c -p -o $*.obj temp.m
+       mtobin $*.obj $*.bin
 
 .spb.pwbin:
+       echo making $*.pwbin
        cp org_statement temp.m
        cat $*.spb >>temp.m
-       macross temp.m  -o m.out
-       loadrom -p 0 -t < m.out > $*.pwbin
+       macross -c -p -o $*.obj temp.m
+       mtobin $*.obj $*.pwbin
 
-sounds: $(OBJECTS)
+clean:
+       rm *.obj *.bin *.pwbin
diff --git a/sources/c64/Sounds/org_statement b/sources/c64/Sounds/org_statement
new file mode 100644 (file)
index 0000000..02435df
--- /dev/null
@@ -0,0 +1,2 @@
+       org     0x1000
+
diff --git a/sources/c64/Tools/filldisk/d64.h b/sources/c64/Tools/filldisk/d64.h
new file mode 100644 (file)
index 0000000..0ade0ce
--- /dev/null
@@ -0,0 +1,23 @@
+#ifndef _D64\r
+#define _D64\r
+\r
+#define SECTOR_SIZE             256\r
+#define TRACKS_PER_DISK         35\r
+#define TRACK_MAX_LARGE         17\r
+#define TRACK_MAX_MEDIUM        24\r
+#define TRACK_MAX_SMALL         30\r
+#define TRACK_MAX_XSMALL        35\r
+#define TRACK_DIRECTORY         18\r
+\r
+#define SECTORS_PER_TRACK_LG    21  /* Tracks  1 - 17 */\r
+#define SECTORS_PER_TRACK_MD    19  /* Tracks 18 - 24 */\r
+#define SECTORS_PER_TRACK_SM    18  /* Tracks 25 - 30 */\r
+#define SECTORS_PER_TRACK_XS    17  /* Tracks 31 - 35 */\r
+\r
+#define SECTORS_LARGE           (SECTORS_PER_TRACK_LG * TRACK_MAX_LARGE)\r
+#define SECTORS_MEDIUM          (SECTORS_PER_TRACK_MD * (TRACK_MAX_MEDIUM - TRACK_MAX_LARGE))\r
+#define SECTORS_SMALL           (SECTORS_PER_TRACK_SM * (TRACK_MAX_SMALL - TRACK_MAX_MEDIUM))\r
+#define SECTORS_XSMALL          (SECTORS_PER_TRACK_XS * (TRACK_MAX_XSMALL - TRACK_MAX_SMALL))\r
+#define SECTORS_PER_DISK        (SECTORS_LARGE + SECTORS_MEDIUM + SECTORS_SMALL + SECTORS_XSMALL)   /* 683 */\r
+\r
+#endif /* _D64 */\r
diff --git a/sources/c64/Tools/filldisk/filldisk.c b/sources/c64/Tools/filldisk/filldisk.c
new file mode 100644 (file)
index 0000000..d320dbc
--- /dev/null
@@ -0,0 +1,363 @@
+#include "global.h"\r
+#include "d64.h"\r
+\r
+#define BUFFER_SIZE  1024 * 1024 * 1   /* 1 MB working space. */\r
+\r
+#define REQUIRED_FILES          8\r
+#define REQUIRED_FILENAME_LEN   20\r
+\r
+/* Required filenames. */\r
+#define CLASS_FILENAME   "class.dat"\r
+#define ACTION_FILENAME  "action.dat"\r
+#define SOUND_FILENAME   "sound.dat"\r
+#define IMAGE_FILENAME   "image.dat"\r
+#define HEAD_FILENAME    "head.dat"\r
+#define ID_FILENAME      "id_file.dat"\r
+#define LOADER_FILENAME  "loader.obj"\r
+#define CHARSET_FILENAME "on_disk_charset.dat"\r
+\r
+/* Default disk offsets. */\r
+#define CLASS_DISKOFFSET   0  /* 0x0100 */\r
+#define ACTION_DISKOFFSET  (1 * SECTORS_PER_TRACK_LG * SECTOR_SIZE)  /* 0x0200 */\r
+#define SOUND_DISKOFFSET   (5 * SECTORS_PER_TRACK_LG * SECTOR_SIZE)  /* 0x0600 */\r
+#define IMAGE_DISKOFFSET   (6 * SECTORS_PER_TRACK_LG * SECTOR_SIZE)  /* 0x0700 */\r
+#define HEAD_DISKOFFSET    (17 * SECTORS_PER_TRACK_LG * SECTOR_SIZE + (21 - 17) * SECTORS_PER_TRACK_MD * SECTOR_SIZE) /* 0x1600 */\r
+#define ID_DISKOFFSET      (17 * SECTORS_PER_TRACK_LG * SECTOR_SIZE) /* 0x1200 */\r
+#define LOADER_DISKOFFSET  (17 * SECTORS_PER_TRACK_LG * SECTOR_SIZE + 1 * SECTOR_SIZE) /* id_file + 1 */\r
+#define CHARSET_DISKOFFSET (17 * SECTORS_PER_TRACK_LG * SECTOR_SIZE + 8 * SECTOR_SIZE) /* 0x1208 */\r
+\r
+/* Required tokens. */\r
+#define CLASS_TOKEN      "class_file"\r
+#define ACTION_TOKEN     "action_file"\r
+#define SOUND_TOKEN      "sound_file"\r
+#define IMAGE_TOKEN      "image_file"\r
+#define HEAD_TOKEN       "head_file"\r
+#define ID_TOKEN         "id_file"\r
+#define LOADER_TOKEN     "loader_file"\r
+#define CHARSET_TOKEN    "charset_file"\r
+\r
+typedef struct\r
+{\r
+       unsigned char *buffer_offset;\r
+       unsigned long disk_offset;\r
+} file_descriptor;\r
+\r
+void file_print_error(const char *name)\r
+{\r
+       printf ("Unable to open file %s\n", name);\r
+}\r
+\r
+/* Advance to first non-white-space character in buffer of max size. */\r
+unsigned long skip_white_space(unsigned char *buffer, unsigned long offset, unsigned long max)\r
+{\r
+       /* Skip white space and carriage return / linefeed. */\r
+       while (((buffer[offset] == ' ') || (buffer[offset] == '\t') ||\r
+               (buffer[offset] == '\r') || (buffer[offset] == '\n')) && (offset < max))\r
+               offset++;\r
+\r
+       return offset;\r
+}\r
+\r
+/* Return offset of endline marked by a carriage return, linefeed or comment marker. */\r
+unsigned long seek_endline(unsigned char *buffer, const char comment,\r
+       unsigned long offset, unsigned long max)\r
+{\r
+       while ((!((buffer[offset] == comment) || (buffer[offset] == '\r')\r
+                   || (buffer[offset] == '\n'))) && (offset < max))\r
+               offset++;\r
+\r
+       return offset;\r
+}\r
+\r
+/* Search for token in buffer of max size, with case sensitivity and option to advance to end of match. */\r
+unsigned long seek_token(const char *token, unsigned char *buffer,\r
+       unsigned long offset, unsigned long max, bool case_sensitive, bool advance)\r
+{\r
+       unsigned long len = 0;\r
+       unsigned long(*proc)(const char *, const char *, size_t) = strnicmp;\r
+       char t_upper, t_lower;\r
+\r
+       t_upper = t_lower = token[0];\r
+\r
+       /* Select string comparison function based on case sensitivity. */\r
+       if (case_sensitive)\r
+               proc = strncmp;\r
+       else\r
+       {\r
+               t_upper = toupper(token[0]);\r
+               t_lower = tolower(token[0]);\r
+       }\r
+\r
+       /* Find token length. */\r
+       len = strlen(token);\r
+\r
+       /* Reduce search by token length. */\r
+       if (len > max)\r
+               return max;\r
+       else\r
+               max -= len;\r
+\r
+       while (offset < max)\r
+       {\r
+               /* Quickly reject all that don't match first token character. */\r
+               while (!((buffer[offset] == t_upper) || (buffer[offset] == t_lower)) && (offset < max))\r
+                       offset++;\r
+\r
+               /* Compare token string against buffer at offset. */\r
+               if (proc(&buffer[offset], token, len) == 0)\r
+               {\r
+                       if (advance)\r
+                               offset += len;\r
+                       return offset;\r
+               }\r
+\r
+               offset++;\r
+       }\r
+\r
+       /* If token not matched, return original max value. */\r
+       return (max + len);\r
+}\r
+\r
+/* Search for token in buffer using rule that token must exist on a single line with optional comments. */\r
+unsigned long seek_token_lined(const char *token, unsigned char *buffer,\r
+       unsigned long offset, unsigned long max, const char comment, bool case_sensitive, bool advance)\r
+{\r
+       unsigned long endline;\r
+\r
+       while (offset < max)\r
+       {\r
+               /* Find the end of the line terminated by newline, carriage return, or start of comment. */\r
+               offset = skip_white_space(buffer, offset, max);\r
+               if ((endline = seek_endline(buffer, comment, offset, max)) < (max - 1))\r
+                       endline++;\r
+\r
+               /* Seek token on single line. */\r
+               if ((offset = seek_token(token, buffer, offset, endline, case_sensitive, advance)) < endline)\r
+                       break;\r
+\r
+               /* Advance to true end of line including comments. */\r
+               offset = seek_endline(buffer, '\0', offset, max);\r
+       }\r
+\r
+       return offset;\r
+}\r
+\r
+/* Search for equate entry of the form "define token = value". */\r
+unsigned long equate_seek_entry(const char *token, unsigned char *buffer, unsigned long offset, unsigned long max)\r
+{\r
+       unsigned long linemax, mark;\r
+\r
+       while (offset < max)\r
+       {\r
+               /* Search line-by-line for ini section header, skip past comments marked with a semi-colon. */\r
+               if ((mark = seek_token_lined("define", buffer, offset, max, ';', FALSE, TRUE)) < max)\r
+               {\r
+                       linemax = seek_endline(buffer, ';', mark, max);\r
+                       if ((mark = seek_token(token, buffer, mark, linemax, FALSE, TRUE)) < linemax)\r
+                       {\r
+                               mark = skip_white_space(buffer, mark, linemax);\r
+                               if (buffer[mark] == '=')\r
+                               {\r
+                                       mark = skip_white_space(buffer, mark + 1, linemax);\r
+                                       return mark;\r
+                               }\r
+                       }\r
+               }\r
+               offset = mark;\r
+       }\r
+\r
+       return max;\r
+}\r
+\r
+/* Convert hex word 0x0000 to byte offset, return -1 if non hex value found. */\r
+long equate_convert_value(unsigned char *buffer, unsigned long offset, unsigned long max)\r
+{\r
+       long value = -1;\r
+       int track;\r
+\r
+       if (buffer[offset] == '0')\r
+       {\r
+               if ((buffer[offset+1] == 'x') || (buffer[offset+1] == 'X'))\r
+               {\r
+                       /* Convert track to sector offset. */\r
+                       track = ((buffer[offset + 2] - '0') * 16 + (buffer[offset + 3] - '1'));\r
+                       if (track > TRACK_MAX_LARGE)\r
+                       {\r
+                               if (track > TRACK_MAX_MEDIUM)\r
+                               {\r
+                                       if (value > TRACK_MAX_SMALL)\r
+                                               value = (SECTORS_LARGE + SECTORS_MEDIUM + SECTORS_SMALL + (track - TRACK_MAX_SMALL) * SECTORS_PER_TRACK_XS) * SECTOR_SIZE;\r
+                                       else\r
+                                               value = (SECTORS_LARGE + SECTORS_MEDIUM + (track - TRACK_MAX_MEDIUM) * SECTORS_PER_TRACK_SM) * SECTOR_SIZE;\r
+                               }\r
+                               else\r
+                                       value = (SECTORS_LARGE + (track - TRACK_MAX_LARGE) * SECTORS_PER_TRACK_MD) * SECTOR_SIZE;\r
+                       }\r
+                       else\r
+                               value = track * SECTORS_PER_TRACK_LG * SECTOR_SIZE;\r
+\r
+                       value += ((buffer[offset + 4] - '0') * 16 + (buffer[offset + 5] - '0')) * SECTOR_SIZE;\r
+               }\r
+       }\r
+\r
+       return value;\r
+}\r
+\r
+/* Find value of token for use in substitution. */\r
+long equate_token_value(unsigned char *buffer, unsigned long offset, unsigned long max)\r
+{\r
+       char readstring[REQUIRED_FILENAME_LEN];\r
+       unsigned long linemax, mark;\r
+       long value = 0;\r
+\r
+       /* Get new token string to lookup. */\r
+       linemax = seek_endline(buffer, ';', offset, max);\r
+       mark = 0;\r
+       while ((!((buffer[offset] == '+') || (buffer[offset] == '-') || (buffer[offset] == ' ')\r
+               || (buffer[offset] == '\t'))) && (offset < linemax))\r
+       {\r
+               readstring[mark++] = buffer[offset++];\r
+       }\r
+       readstring[mark] = '\0';\r
+       mark = offset;\r
+\r
+       /* Find token in file and retrieve value. */\r
+       if ((offset = equate_seek_entry(readstring, buffer, 0, max)) < max)\r
+       {\r
+               if ((value = equate_convert_value(buffer, offset, max)) >= 0)\r
+               {\r
+                       offset = mark;\r
+                       linemax = seek_endline(buffer, ';', offset, max);\r
+                       mark = 0;\r
+                       while (((buffer[offset] >= '0') && (buffer[offset] <= '9'))\r
+                               || (buffer[offset] == '+') || (buffer[offset] == '-'))\r
+                               readstring[mark++] = buffer[offset++];\r
+                       readstring[mark] = '\0';\r
+                       value += (atoi(readstring) * SECTOR_SIZE);\r
+               }\r
+       }\r
+}\r
+\r
+int main(int argc, char *argv[])\r
+{\r
+       file_descriptor required_files[REQUIRED_FILES];\r
+       const char filename[REQUIRED_FILES][REQUIRED_FILENAME_LEN] =\r
+       {\r
+               CLASS_FILENAME, ACTION_FILENAME, SOUND_FILENAME, IMAGE_FILENAME,\r
+               HEAD_FILENAME, ID_FILENAME, LOADER_FILENAME, CHARSET_FILENAME\r
+       };\r
+       const unsigned long required_default[REQUIRED_FILES] =\r
+       {\r
+               CLASS_DISKOFFSET, ACTION_DISKOFFSET, SOUND_DISKOFFSET, IMAGE_DISKOFFSET,\r
+               HEAD_DISKOFFSET, ID_DISKOFFSET, LOADER_DISKOFFSET, CHARSET_DISKOFFSET\r
+       };\r
+       const char token[REQUIRED_FILES][REQUIRED_FILENAME_LEN] =\r
+       {\r
+               CLASS_TOKEN, ACTION_TOKEN, SOUND_TOKEN, IMAGE_TOKEN,\r
+               HEAD_TOKEN, ID_TOKEN, LOADER_TOKEN, CHARSET_TOKEN\r
+       };\r
+       FILE *currentfile = NULL;\r
+       unsigned long size, offset;\r
+       long value;\r
+       char *inbuffer = NULL, *outbuffer;\r
+       int i, rval = SYS_ERROR;\r
+\r
+    /* Basic argument checking. */\r
+    if (argc < 3)\r
+    {\r
+        printf ("Usage: filldisk equates_file output.d64\n");\r
+        printf ("Example: filldisk dataequates.m datadisk.d64\n");\r
+        goto main_cleanup;\r
+    }\r
+\r
+       /* Allocate memory for working buffer. */\r
+       if ((inbuffer = malloc(BUFFER_SIZE * 2)) == NULL)\r
+       {\r
+               printf("Out of memory\n");\r
+               goto main_cleanup;\r
+       }\r
+       outbuffer = inbuffer + BUFFER_SIZE;\r
+\r
+       /* Open input file. */\r
+       if ((currentfile = fopen(argv[1], "rb")) == NULL)\r
+       {\r
+               file_print_error(argv[1]);\r
+               goto main_cleanup;\r
+       }\r
+\r
+       /* Read file to input buffer and close file. */\r
+       if (!(size = (unsigned long)fread(inbuffer, 1, BUFFER_SIZE, currentfile)))\r
+       {\r
+               file_print_error(argv[1]);\r
+               goto main_cleanup;\r
+       }\r
+       fclose(currentfile);\r
+       currentfile = NULL;\r
+\r
+       for (i = 0; i < REQUIRED_FILES; i++)\r
+       {\r
+               required_files[i].disk_offset = required_default[i];\r
+               if ((offset = equate_seek_entry(token[i], inbuffer, 0, size)) < size)\r
+               {\r
+                       /* Attempt to read disk offset value directly. */\r
+                       if ((value = equate_convert_value(inbuffer, offset, size)) < 0)\r
+                       {\r
+                               /* If direct value not found, try looking up referenced token value. */\r
+                               value = equate_token_value(inbuffer, offset, size);\r
+                       }\r
+                       required_files[i].disk_offset = value;\r
+               }\r
+       }\r
+\r
+       /* Set default sector fill with 0xFF. */\r
+       memset(outbuffer, 0xFF, SECTORS_PER_DISK * SECTOR_SIZE);\r
+\r
+       for (i = 0; i < REQUIRED_FILES; i++)\r
+       {\r
+               /* Open required file. */\r
+               if ((currentfile = fopen(filename[i], "rb")) == NULL)\r
+               {\r
+                       file_print_error(filename[i]);\r
+                       goto main_cleanup;\r
+               }\r
+\r
+               /* Read file to input buffer and close file. */\r
+               if (!(size = (unsigned long)fread(inbuffer, 1, BUFFER_SIZE, currentfile)))\r
+               {\r
+                       file_print_error(filename[i]);\r
+                       goto main_cleanup;\r
+               }\r
+               fclose(currentfile);\r
+               currentfile = NULL;\r
+\r
+               /* Copy input file to destination location in outbuffer. */\r
+               memcpy((outbuffer + required_files[i].disk_offset), inbuffer, size);\r
+       }\r
+\r
+       /* Open output file. */\r
+       if ((currentfile = fopen(argv[2], "wb")) == NULL)\r
+       {\r
+               file_print_error(argv[2]);\r
+               goto main_cleanup;\r
+       }\r
+\r
+       /* Write buffer to file. */\r
+       if (fwrite(outbuffer, 1, (SECTORS_PER_DISK * SECTOR_SIZE), currentfile) != (SECTORS_PER_DISK * SECTOR_SIZE))\r
+       {\r
+               printf("Error writing to %s\n", argv[2]);\r
+               goto main_cleanup;\r
+       }\r
+       fclose(currentfile);\r
+       currentfile = NULL;\r
+\r
+       rval = SYS_OK;\r
+\r
+main_cleanup:\r
+       if (currentfile)\r
+               fclose(currentfile);\r
+       if (inbuffer)\r
+               free(inbuffer);\r
+\r
+       return rval;\r
+}\r
+\r
diff --git a/sources/c64/Tools/filldisk/global.h b/sources/c64/Tools/filldisk/global.h
new file mode 100644 (file)
index 0000000..f724864
--- /dev/null
@@ -0,0 +1,40 @@
+#ifndef _GLOBAL\r
+#define _GLOBAL\r
+\r
+/* Compile flags. */\r
+#define WIN32_LEAN_AND_MEAN             /* Ignore large portion of Windows-specific headers. */\r
+#define _CRT_SECURE_NO_WARNINGS\r
+#define _CRT_NONSTDC_NO_DEPRECATE\r
+\r
+#ifdef __cplusplus\r
+#include <iostream>\r
+using namespace std;\r
+#endif /* __cplusplus */\r
+\r
+#include <wtypes.h>\r
+#include <stdio.h>\r
+#include <stdlib.h>\r
+#include <assert.h>\r
+\r
+/* Application parameters. */\r
+#ifndef TITLE\r
+#define TITLE           "TaskID"\r
+#endif\r
+#ifndef VERSION\r
+#define VERSION         "1.0"\r
+#endif\r
+\r
+#ifndef bool\r
+#define bool BOOL\r
+#endif\r
+\r
+#ifndef inline\r
+#define inline _inline\r
+#endif\r
+\r
+#define SYS_OK          0\r
+#define SYS_ERROR       1\r
+\r
+#define MAX_LINE_LEN    1024\r
+\r
+#endif /* _GLOBAL */\r
diff --git a/sources/c64/Tools/filldisk/solution/filldisk.sln b/sources/c64/Tools/filldisk/solution/filldisk.sln
new file mode 100644 (file)
index 0000000..7299f17
--- /dev/null
@@ -0,0 +1,22 @@
+\r
+Microsoft Visual Studio Solution File, Format Version 12.00\r
+# Visual Studio Express 2013 for Windows Desktop\r
+VisualStudioVersion = 12.0.21005.1\r
+MinimumVisualStudioVersion = 10.0.40219.1\r
+Project("{8A5CB702-8EA0-4EB4-A3CD-91BDA21B7F14}") = "filldisk", "filldisk.vcxproj", "{3F4D8C00-A25B-4C0A-BC5D-CC2450B66DC5}"\r
+EndProject\r
+Global\r
+       GlobalSection(SolutionConfigurationPlatforms) = preSolution\r
+               Debug|Win32 = Debug|Win32\r
+               Release|Win32 = Release|Win32\r
+       EndGlobalSection\r
+       GlobalSection(ProjectConfigurationPlatforms) = postSolution\r
+               {3F4D8C00-A25B-4C0A-BC5D-CC2450B66DC5}.Debug|Win32.ActiveCfg = Debug|Win32\r
+               {3F4D8C00-A25B-4C0A-BC5D-CC2450B66DC5}.Debug|Win32.Build.0 = Debug|Win32\r
+               {3F4D8C00-A25B-4C0A-BC5D-CC2450B66DC5}.Release|Win32.ActiveCfg = Release|Win32\r
+               {3F4D8C00-A25B-4C0A-BC5D-CC2450B66DC5}.Release|Win32.Build.0 = Release|Win32\r
+       EndGlobalSection\r
+       GlobalSection(SolutionProperties) = preSolution\r
+               HideSolutionNode = FALSE\r
+       EndGlobalSection\r
+EndGlobal\r
diff --git a/sources/c64/Tools/filldisk/solution/filldisk.vcxproj b/sources/c64/Tools/filldisk/solution/filldisk.vcxproj
new file mode 100644 (file)
index 0000000..45b55eb
--- /dev/null
@@ -0,0 +1,92 @@
+<?xml version="1.0" encoding="utf-8"?>\r
+<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
+  <ItemGroup Label="ProjectConfigurations">\r
+    <ProjectConfiguration Include="Debug|Win32">\r
+      <Configuration>Debug</Configuration>\r
+      <Platform>Win32</Platform>\r
+    </ProjectConfiguration>\r
+    <ProjectConfiguration Include="Release|Win32">\r
+      <Configuration>Release</Configuration>\r
+      <Platform>Win32</Platform>\r
+    </ProjectConfiguration>\r
+  </ItemGroup>\r
+  <PropertyGroup Label="Globals">\r
+    <ProjectGuid>{3F4D8C00-A25B-4C0A-BC5D-CC2450B66DC5}</ProjectGuid>\r
+    <Keyword>Win32Proj</Keyword>\r
+    <RootNamespace>filldisk</RootNamespace>\r
+  </PropertyGroup>\r
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">\r
+    <ConfigurationType>Application</ConfigurationType>\r
+    <UseDebugLibraries>true</UseDebugLibraries>\r
+    <PlatformToolset>v140</PlatformToolset>\r
+    <CharacterSet>Unicode</CharacterSet>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">\r
+    <ConfigurationType>Application</ConfigurationType>\r
+    <UseDebugLibraries>false</UseDebugLibraries>\r
+    <PlatformToolset>v140</PlatformToolset>\r
+    <WholeProgramOptimization>true</WholeProgramOptimization>\r
+    <CharacterSet>Unicode</CharacterSet>\r
+  </PropertyGroup>\r
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />\r
+  <ImportGroup Label="ExtensionSettings">\r
+  </ImportGroup>\r
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+  </ImportGroup>\r
+  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">\r
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
+  </ImportGroup>\r
+  <PropertyGroup Label="UserMacros" />\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">\r
+    <LinkIncremental>true</LinkIncremental>\r
+    <IncludePath>$(VC_IncludePath);$(WindowsSDK_IncludePath);..\..\core;..\..\dx9\include</IncludePath>\r
+  </PropertyGroup>\r
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">\r
+    <LinkIncremental>false</LinkIncremental>\r
+    <IncludePath>$(VC_IncludePath);$(WindowsSDK_IncludePath);..\..\core;..\..\dx9\include</IncludePath>\r
+  </PropertyGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">\r
+    <ClCompile>\r
+      <PrecompiledHeader>\r
+      </PrecompiledHeader>\r
+      <WarningLevel>Level3</WarningLevel>\r
+      <Optimization>Disabled</Optimization>\r
+      <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <CompileAs>Default</CompileAs>\r
+      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>\r
+    </ClCompile>\r
+    <Link>\r
+      <SubSystem>Console</SubSystem>\r
+      <GenerateDebugInformation>true</GenerateDebugInformation>\r
+    </Link>\r
+  </ItemDefinitionGroup>\r
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">\r
+    <ClCompile>\r
+      <WarningLevel>Level3</WarningLevel>\r
+      <PrecompiledHeader>\r
+      </PrecompiledHeader>\r
+      <Optimization>MaxSpeed</Optimization>\r
+      <FunctionLevelLinking>true</FunctionLevelLinking>\r
+      <IntrinsicFunctions>true</IntrinsicFunctions>\r
+      <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>\r
+    </ClCompile>\r
+    <Link>\r
+      <SubSystem>Console</SubSystem>\r
+      <GenerateDebugInformation>true</GenerateDebugInformation>\r
+      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r
+      <OptimizeReferences>true</OptimizeReferences>\r
+    </Link>\r
+  </ItemDefinitionGroup>\r
+  <ItemGroup>\r
+    <ClCompile Include="..\filldisk.c" />\r
+  </ItemGroup>\r
+  <ItemGroup>\r
+    <ClInclude Include="..\global.h" />\r
+  </ItemGroup>\r
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />\r
+  <ImportGroup Label="ExtensionTargets">\r
+  </ImportGroup>\r
+</Project>
\ No newline at end of file
diff --git a/sources/c64/loader.obj b/sources/c64/loader.obj
new file mode 100644 (file)
index 0000000..7cdab43
Binary files /dev/null and b/sources/c64/loader.obj differ