Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/Al-Nafuur/1942-bB
Browse files Browse the repository at this point in the history
  • Loading branch information
Al-Nafuur committed Oct 26, 2022
2 parents 84812fb + f98d2a6 commit 9a7d0ed
Show file tree
Hide file tree
Showing 8 changed files with 507 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@
**/includes.bB
**/2600basic_variable_redefs.h
**/*.bas.asm
**/.DS_Store
10 changes: 8 additions & 2 deletions src/1942_HSC.bas
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ end
; Color constants are defined in external ASM file
inline NTSC_PAL_colors.asm

; In game score font
const font = custom

; Title screen score font
const fontstyle = CUSTOM

; To use the ASM defined colors in bB assignments they have to be redefined,
; otherwise bB is using the ZP memory instead!
const _Color_Ocean = _96
Expand All @@ -72,7 +78,7 @@ end
const _Color_Titlescreen_BG = _00
const _Color_Player_Plane_Base = _2A
const _Color_Player_Plane_Bottom = _26
const _Color_Score = _0E
const _Color_Score = _9E
const _Color_Player_Bullet = _40

; Kernel and Minikernel constants
Expand Down Expand Up @@ -2045,7 +2051,7 @@ FontColorsEndscreen
OffsetGameOver
DC.B 176, 176, 176, 200, 176, 176, 48, 24, 176, 176
FontColorsGameOver
DC.B _0E, _0E, _0E, _44, _0E, _0E, _0E, _0E, _0E, _0E, _0E
DC.B _Color_Score, _0E, _0E, _44, _0E, _0E, _0E, _0E, _0E, _0E, _0E


ALIGN 256
Expand Down
84 changes: 84 additions & 0 deletions src/2600basicfooter.asm
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
; Provided under the CC0 license. See the included LICENSE.txt for details.

ifconst bankswitch
if bankswitch == 8
ifconst PlusROM_functions
ORG $2FF0
RORG $FFF0
.byte 0 ; WriteToBuffer
.byte 0 ; WriteSendBuffer
.byte 0 ; ReceiveBuffer
.byte $ff ; ReceiveBufferSize (none zero for detection of PlusROM support)
ORG $2FFA
RORG $FFFA
.word (PlusROM_API)
else
ORG $2FFC
RORG $FFFC
endif
endif
if bankswitch == 16
ifconst PlusROM_functions
ORG $4FF0
RORG $FFF0
.byte 0 ; WriteToBuffer
.byte 0 ; WriteSendBuffer
.byte 0 ; ReceiveBuffer
.byte $ff ; ReceiveBufferSize (none zero for detection of PlusROM support)
ORG $4FFA
RORG $FFFA
.word (PlusROM_API)
else
ORG $4FFC
RORG $FFFC
endif
endif
if bankswitch == 32
ifconst PlusROM_functions
ORG $8FF0
RORG $FFF0
.byte 0 ; WriteToBuffer
.byte 0 ; WriteSendBuffer
.byte 0 ; ReceiveBuffer
.byte $ff ; ReceiveBufferSize (none zero for detection of PlusROM support)
ORG $8FFA
RORG $FFFA
.word (PlusROM_API)
else
ORG $8FFC
RORG $FFFC
endif
endif
if bankswitch == 64
ORG $10FF0
RORG $1FFF0
lda $ffe0 ; we use wasted space to assist stella with EF format auto-detection
ORG $10FF8
RORG $1FFF8
ifconst superchip
.byte "E","F","S","C"
else
.byte "E","F","E","F"
endif
ORG $10FFC
RORG $1FFFC
endif
else
ifconst ROM2k
ifconst PlusROM_functions
ORG $F7FA
.word (PlusROM_API)
else
ORG $F7FC
endif
else
ifconst PlusROM_functions
ORG $FFFA
.word (PlusROM_API)
else
ORG $FFFC
endif
endif
endif
.word (start & $ffff)
.word (start & $ffff)
15 changes: 15 additions & 0 deletions src/PlusROM_functions.asm
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
PlusROM_functions = 1
WriteToBuffer = $1ff0
WriteSendBuffer = $1ff1
ReceiveBuffer = $1ff2
ReceiveBufferSize = $1ff3

MAC SET_PLUSROM_API ; {1} = path, {2} = domain
OLD_RORG = *
REND
PlusROM_API
.byte {1}, 0, {2}, 0
ECHO "Size of PlusROM API definition: ", [( * - PlusROM_API )]d
RORG (OLD_RORG + ( * - PlusROM_API ))
ENDM
65 changes: 65 additions & 0 deletions src/banksw.asm
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
; Provided under the CC0 license. See the included LICENSE.txt for details.

; every bank has this stuff at the same place
; this code can switch to/from any bank at any entry point
; and can preserve register values
; note: lines not starting with a space are not placed in all banks
;
; line below tells the compiler how long this is - do not remove
;size=35

begin_bscode
ldx #$ff
ifconst FASTFETCH ; using DPC+
stx FASTFETCH
endif
txs
if bankswitch == 64
lda #(((>(start-1)) & $0F) | $F0)
else
lda #>(start-1)
endif
pha
lda #<(start-1)
pha

BS_return
pha
txa
pha
tsx

if bankswitch != 64
lda 4,x ; get high byte of return address

rol
rol
rol
rol
and #bs_mask ;1 3 or 7 for F8/F6/F4
tax
inx
else
lda 4,x ; get high byte of return address
tay
ora #$10 ; change our bank nibble into a valid rom mirror
sta 4,x
tya
lsr
lsr
lsr
lsr
tax
inx
endif

BS_jsr
lda bankswitch_hotspot-1,x
pla
tax
pla
rts
if ((* & $1FFF) > ((bankswitch_hotspot & $1FFF) - 1))
echo "WARNING: size parameter in banksw.asm too small - the program probably will not work."
echo "Change to",[(*-begin_bscode+1)&$FF]d,"and try again."
endif

0 comments on commit 9a7d0ed

Please sign in to comment.