diff --git a/res/hgr/ALCAZAR b/res/hgr/ALCAZAR new file mode 100644 index 000000000..08ffd3472 Binary files /dev/null and b/res/hgr/ALCAZAR differ diff --git a/res/hgr/BELLHOP b/res/hgr/BELLHOP new file mode 100644 index 000000000..ce1688383 Binary files /dev/null and b/res/hgr/BELLHOP differ diff --git a/res/hgr/BLISTER.BALL b/res/hgr/BLISTER.BALL new file mode 100644 index 000000000..651ccbade Binary files /dev/null and b/res/hgr/BLISTER.BALL differ diff --git a/res/hgr/BUDGETRILOGY b/res/hgr/BUDGETRILOGY new file mode 100644 index 000000000..f349e1f86 Binary files /dev/null and b/res/hgr/BUDGETRILOGY differ diff --git a/res/hgr/CANYON.CLIMBER b/res/hgr/CANYON.CLIMBER new file mode 100644 index 000000000..246eb7c43 Binary files /dev/null and b/res/hgr/CANYON.CLIMBER differ diff --git a/res/hgr/DAVIDS.MAGIC b/res/hgr/DAVIDS.MAGIC new file mode 100644 index 000000000..e934e6dbc Binary files /dev/null and b/res/hgr/DAVIDS.MAGIC differ diff --git a/res/hgr/DROL b/res/hgr/DROL new file mode 100644 index 000000000..d8cfc5396 Binary files /dev/null and b/res/hgr/DROL differ diff --git a/res/hgr/FS1 b/res/hgr/FS1 new file mode 100644 index 000000000..df51c6e9c Binary files /dev/null and b/res/hgr/FS1 differ diff --git a/res/hgr/HEAD.ON b/res/hgr/HEAD.ON new file mode 100644 index 000000000..09b4ad75e Binary files /dev/null and b/res/hgr/HEAD.ON differ diff --git a/res/hgr/MAD.BOMBER b/res/hgr/MAD.BOMBER new file mode 100644 index 000000000..0b804afac Binary files /dev/null and b/res/hgr/MAD.BOMBER differ diff --git a/res/hgr/MARIO.BROS b/res/hgr/MARIO.BROS new file mode 100644 index 000000000..9470cd389 Binary files /dev/null and b/res/hgr/MARIO.BROS differ diff --git a/res/hgr/MONTEZUMA b/res/hgr/MONTEZUMA new file mode 100644 index 000000000..9c2f1f860 Binary files /dev/null and b/res/hgr/MONTEZUMA differ diff --git a/res/woz/Rescue Raiders - Disk 1, Side B.woz b/res/woz/Rescue Raiders - Disk 1, Side B.woz deleted file mode 100644 index ce89ba6ae..000000000 Binary files a/res/woz/Rescue Raiders - Disk 1, Side B.woz and /dev/null differ diff --git a/src/4cade.a b/src/4cade.a index 0f2e16ac7..f1049a997 100644 --- a/src/4cade.a +++ b/src/4cade.a @@ -2,14 +2,134 @@ !to "build/LAUNCHER.SYSTEM",plain *=$2000 -MEMFLAG = $FF ; bit 7 = 0 if 64K, 1 if 128K +Has128KStatus =$FF ; [byte] set by Has128K -MACHID = $BF98 ; machine identification byte + !source "src/constants.a" + !source "src/macros.a" - lda MACHID - and #$30 - cmp #$30 ; C=0 if 64K, C=1 if 128K - ror MEMFLAG ; set bit 7 from C + jsr Has128K +- ldx #0 + beq - + +;------------------------------------------------------------------------------ +; Has128K +; Checks whether computer has auxiliary memory (i.e. 128K) +; +; in: none +; out: zero page $FF has +; $00 = not a //e +; $20 = //e but no 80-col card +; $40 = 80-col card but no aux mem +; $80 = aux mem detected (yay!) +; all other flags clobbered +; all registers clobbered +; zero page $1A-$1D clobbered +; +; original was AUX.MEM.CHECK from "Extra K" +; (c) 1986 Beagle Bros +; written by Alan Bird and Mark Simonsen, 1986-03-28 +;------------------------------------------------------------------------------ +Has128K + php + sei + lda $E000 ; store values from language card + sta $1A ; (used later to determine which + lda $D000 ; RAM bank is active and reset it) + sta $1B + lda $D400 + sta $1C + lda $D800 + sta $1D + lda ROMIN + lda ROMIN + lda MACHINEID + cmp #$06 + bne @noiie + lda SLOT3STATUS + bmi @no80col + lda AUXMEMSTATUS + bmi @yesauxmem + lda AUXZPSTATUS + bmi @yesauxmem + ldy #$28 +- ldx @checker,Y + lda $100,Y + sta @checker,Y + txa + sta $100,Y + dey + bpl - + jmp $100 +@postcheck + ldy #$28 +- lda @checker,Y + sta $100,Y + dey + bpl - + bcs @noauxmem +@yesauxmem + lda #$80 + +HIDE_NEXT_2_BYTES +@noauxmem + lda #$40 + +HIDE_NEXT_2_BYTES +@no80col + lda #$20 + +HIDE_NEXT_2_BYTES +@noiie + lda #$00 + sta Has128KStatus + lda $E000 + cmp $1A + bne @tryRAMbank1 + lda $D000 + cmp $1B + bne @tryRAMbank1 + lda $D400 + cmp $1C + bne @tryRAMbank1 + lda $D800 + cmp $1D + beq @done +@tryRAMbank1 + lda LCBANK1READ + lda $E000 + cmp $1A + bne @tryRAMbank2 + lda $D000 + cmp $1B + bne @tryRAMbank2 + lda $D400 + cmp $1C + bne @tryRAMbank2 + lda $D800 + cmp $1D + beq @done +@tryRAMbank2 + lda LCBANK2READ +@done + plp + lda Has128KStatus + rts +@checker + lda #$EE + sta WRITEAUXMEM + sta READAUXMEM + sta $800 + lda $C00 + cmp #$EE + bne @auxworks + asl $C00 + lda $800 + cmp $C00 + bne @auxworks + sec + +HIDE_NEXT_BYTE +@auxworks + clc + sta WRITEMAINMEM + sta READMAINMEM + jmp @postcheck ; jsr init ; initialize ProRWTS2 ; lda $C08B @@ -27,12 +147,9 @@ MACHID = $BF98 ; machine identification byte ; bit $C052 ; bit $C057 ; bit $C050 -- lda #0 - beq - - -cover !byte cover_e-cover_b -cover_b !text "COVER" -cover_e +;cover !byte cover_e-cover_b +;cover_b !text "COVER" +;cover_e ;LoadDHGR ; sta $C000 diff --git a/src/constants.a b/src/constants.a index 80191f6ad..01c201b07 100644 --- a/src/constants.a +++ b/src/constants.a @@ -2,9 +2,30 @@ ;(c) 2018 by 4am ; +; soft switches +STOREOFF = $C000 ; write to use following flags: +READMAINMEM = $C002 ; write to R main mem +READAUXMEM = $C003 ; write to R aux mem +WRITEMAINMEM = $C004 ; write to W main mem +WRITEAUXMEM = $C005 ; write to W aux mem +SETMAINZP = $C008 ; write to R/W main mem zero page +SETAUXZP = $C009 ; write to R/W aux mem zero page +AUXMEMSTATUS = $C013 ; read high bit only +AUXZPSTATUS = $C016 ; read high bit only +SLOT3STATUS = $C017 ; read high bit only + +LCBANK2READ = $C080 ; read once to R RAM bank 2 / no write +ROMIN = $C081 ; read twice to R ROM / W RAM bank 2 +LCBANK2 = $C083 ; read twice to R/W RAM bank 2 +LCBANK1READ = $C088 ; read once to R RAM bank 1 / no write +LCBANK1 = $C08B ; read twice to R/W RAM bank 1 + +; ROM +MACHINEID = $FBB3 + ; zero page -PARAM = $00 ; used by PARAMS_ON_STACK macro, so basically everywhere -PTR = $02 -SRC = $04 -DEST = $06 -SAVE = $08 +PARAM = $00 ; used by PARAMS_ON_STACK macro, so basically everywhere +PTR = $02 +SRC = $04 +DEST = $06 +SAVE = $08