Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
88 changes: 88 additions & 0 deletions LICENSE-ROXAS2712.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
# Roxas2712 — Fork Contributions

Version 1.0 · Effective 25 October 2026

Copyright © 2026 Roxas2712, to the extent of rights held.
All rights reserved except as expressly granted below or already granted.

## 1. Scope and ownership

This notice applies only to original contributions made by Roxas2712
(GitHub: Roxas2712) to `Roxas2712/Gen2Recomped`, including original additions
within modified files, insofar as he owns the relevant rights. Git history,
pull-request diffs and source provenance identify contributions; a commit
author or a whole-file change alone does not establish ownership of every
part of that file.

It does not claim ownership of Cedric's work, Gen1Recomp / BOIS CLUB GAMES
work, other contributors' work, third-party dependencies, or ROM-derived
content. Their applicable licences and notices remain in force. It does not
grant permission to distribute the complete combined fork where another
rights holder's permission is required.

## 2. General permission and reserved rights

For contributions covered by this notice and not already licensed more
broadly, you may read and study the published source and make private,
non-commercial modifications and builds for your own use. This grants no
general permission to redistribute, sublicense, sell, or offer those
contributions as a hosted service. Other uses require Roxas2712's
written permission, except for the specific permission below and rights
available independently under applicable law.

Keep the relevant copyright, licence and attribution notices. Do not
represent Roxas2712's contributions as exclusively authored by someone
else. Public source availability alone does not put them in the public
domain or grant an open-source licence.

## 3. Specific permission for Cedric / UNDERdecoded

Roxas2712 expressly grants Cedric (Ced; GitHub: UNDERdecoded /
UNDERdecodedHD) a non-exclusive, worldwide, perpetual, royalty-free
permission to use, reproduce, integrate, modify and distribute the covered
contributions that Roxas2712 submits or expressly offers through pull
requests to `UNDERdecoded/Gen2Recomped`, for Cedric's Gen2Recomped /
RetroRecompiled project. This includes its renamed continuation maintained
by Cedric, its official builds, and its commercial operation.

Cedric may license the incorporated contributions to recipients as part of
that project, subject to preserving this permission's applicable credit and
notice requirements. This permission is not a copyright assignment, is not
exclusive, and does not cover unpublished work, separate repositories,
ModCompass service operation, credentials, or content not offered in those
pull requests. Roxas2712 retains his own rights to his contributions.

For uses relying on this permission:

- retain the relevant source copyright and licence notices;
- give visible credit in the project's README or equivalent public project
page, and in the application's existing About / Credits view, if present;
- use at least the following credit, or a substantially equivalent one:

> Contributions by Roxas2712 —
> https://github.com/Roxas2712

A maintained consolidated contributor credit is sufficient; a separate
credit on every screen or for every change is not required. Adapted
contributions must not be attributed exclusively to another author. Other
contributors' credits must also remain intact.

## 4. Earlier licences and permissions remain effective

This notice does not revoke, narrow, or retrospectively add conditions to
any permission already validly granted, including MIT / GPL grants,
separate agreements, or permissions arising from previously submitted
pull requests. Where an earlier grant permits a use independently of this
notice, its existing terms govern that use. For such earlier uses, the
visible credit above is requested to the extent it is not already required.

For subsequent contributions, this is the default statement of Roxas2712's own reserved rights and the specific PR permission, subject to any
applicable existing licence obligations or separately agreed terms. It
does not change another rights holder's licence or guarantee compatibility
of a particular combination of code.

## 5. No warranty

To the extent permitted by applicable law, these contributions are provided
as is, without warranty. No support obligation, endorsement, or rights to
third-party code, game assets, names, or trademarks are granted.
2 changes: 2 additions & 0 deletions src/battle/BattleState.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3895,6 +3895,8 @@ end
-- any pop (finish, script teardown) must silence the alarm loop
-- (end_of_battle.asm clears wLowHealthAlarm when a battle ends)
function BattleState:exit()
local tasks=package.loaded['src.core.game3.battle.anim_tasks']
if tasks then tasks._nativeExit(self)end
-- Teachy TV temporarily replaces the player's party exactly like
-- SavePlayerParty/LoadPlayerParty in teachy_tv.c. finish() normally
-- restores it before the pop, but exit is the safety net for a forced state
Expand Down
54 changes: 41 additions & 13 deletions src/battle/Gen3MoveAnim.lua
Original file line number Diff line number Diff line change
Expand Up @@ -918,7 +918,7 @@ function Gen3MoveAnim:start(moveId, attackerIsPlayer, attackerPosition, targetPo
-- script's waitforvisualfinish ends at waitLife rather than paying the
-- generic six-frame presentation tail used for particles.
if self.surf and self.surf.waitLife then
self.total = math.max(duration, self.surf.waitLife)
self.total = math.max(duration, (self.surf.at or 0)+self.surf.waitLife)
end
-- ACID ARMOR's task lifetime and the one script-frame delay after clear are
-- fully known, so do not append the generic particle presentation tail.
Expand Down Expand Up @@ -951,6 +951,8 @@ function Gen3MoveAnim:start(moveId, attackerIsPlayer, attackerPosition, targetPo
self.total = math.max(anim.duration or 0,
self.camouflage.waitLife or 0)
end
local tasks=package.loaded['src.core.game3.battle.anim_tasks']
if tasks then tasks._nativeStart(self,battle)end
return true
end

Expand Down Expand Up @@ -989,6 +991,8 @@ function Gen3MoveAnim:update()
self._transformApplied = true
end
end
local tasks=package.loaded['src.core.game3.battle.anim_tasks']
if tasks then tasks._nativeTick(self)end
end

function Gen3MoveAnim:isDone()
Expand All @@ -1000,6 +1004,8 @@ function Gen3MoveAnim:isDone()
end

function Gen3MoveAnim:release()
local tasks=package.loaded['src.core.game3.battle.anim_tasks']
if tasks then tasks._nativeRelease(self)end
self.events, self.total, self.frame, self.fan, self.oamRanks =
nil, nil, 0, nil, nil
self.oamGlobalTieResidual = nil
Expand Down Expand Up @@ -2394,7 +2400,7 @@ end
function Gen3MoveAnim:surfLayer()
local shape = self.surf
if not shape then return nil end
local frame = self.frame or 0
local frame = (self.frame or 0)-(shape.at or 0)
if frame < 0 or frame >= (shape.life or 134) then return nil end
-- the task's two arms: which one is chosen is GetBattlerSide(attacker)
local side = self.attackerIsPlayer and shape.player or shape.opponent
Expand Down Expand Up @@ -4414,17 +4420,8 @@ function Gen3MoveAnim:drawEvent(event, battle, Gen3Battle, Assets, pose,
return true
end

function Gen3MoveAnim:draw(battle, skipEvents)
if not self.events or not battle then return end
local okG3, Gen3Battle = pcall(require, "src.battle.Gen3Battle")
local okA, Assets = pcall(require, "src.render.Assets")
if not (okG3 and okA) then return end
local g = love.graphics
local now = self.frame or 0

-- the wave first, and over everything: the cartridge gives its layer
-- priority 1 and the battlers' sprites priority 2, so it passes in FRONT of
-- the Pokemon it is breaking over
function Gen3MoveAnim:drawSurfNative(battle,Gen3Battle,Assets)
local g=love.graphics
local layer = self:surfLayer()
if layer then
local okImg, img = pcall(Assets.image, layer.image)
Expand All @@ -4451,6 +4448,23 @@ function Gen3MoveAnim:draw(battle, skipEvents)
end
end

end

function Gen3MoveAnim:draw(battle, skipEvents)
if not self.events or not battle then return end
local okG3, Gen3Battle = pcall(require, "src.battle.Gen3Battle")
local okA, Assets = pcall(require, "src.render.Assets")
if not (okG3 and okA) then return end
local g = love.graphics
local now = self.frame or 0

-- the wave first, and over everything: the cartridge gives its layer
-- priority 1 and the battlers' sprites priority 2, so it passes in FRONT of
-- the Pokemon it is breaking over
local tasks=package.loaded['src.core.game3.battle.anim_tasks']
if tasks then tasks._nativeDraw(self,battle,Gen3MoveAnim.drawSurfNative,Gen3Battle,Assets)
else self:drawSurfNative(battle,Gen3Battle,Assets)end

-- ...and the stat-up sparkle, which belongs to ONE Pokemon rather than to
-- the screen: the cartridge centres its layer on the attacker's own sprite.
do
Expand Down Expand Up @@ -4488,4 +4502,18 @@ function Gen3MoveAnim:draw(battle, skipEvents)
end
end

-- Source callbacks borrow these exact native phases. Direct source calls
-- outside the controller cannot start or advance an independent script.
local startNative,updateNative=Gen3MoveAnim.start,Gen3MoveAnim.update
function Gen3MoveAnim:start(...)
local source=package.loaded['src.core.game3.battle.anim_vm']
if source then return source._nativeLaunch(self,startNative,...)end
return startNative(self,...)
end
function Gen3MoveAnim:update(...)
local source=package.loaded['src.core.game3.battle.anim_vm']
if source then return source._nativeUpdate(self,updateNative,...)end
return updateNative(self,...)
end

return Gen3MoveAnim
Loading